On Thursday and Friday we rolled out a very important new feature, cross-site includes, or CSIs. CSIs make it possible to share code across sites. I'll explain roughly how this works, and provide some examples of where we're already using it.
First, to see it working: take any one of your sites, which has a category with pages (e.g. 'mycat'), and create a category _start page that contains just this: [[include :modules:include:8 page=mycat:_start | category=mycat | label=Mystuff]] This pulls in the Hammer Navigator, which shows a list of the pages in that category. Hammer is the pattern that organizes wiki pages as a list.
CSIs work just like normal includes except that you add ':sitename:' in front of the page name. In this example, :modules: refers to http://modules.wikidot.com, a new site we started a few days ago to hold collections of CSIs, which we're calling 'userspace modules' (as compared to the modules Wikidot provides us).
Here is another example, the wishlist module. This lets you add a simple wish list to other pages, e.g. to documentation pages. To install, create wish:_template containing [[include :modules:include:11]] and then in your site manager, mark the wish category as autonumbered. Put this code into your primary page template where you want the wishlist to appear: [[include :modules:include:10]].
CSIs can happily act as live templates, accepting symbols from the calling page. This is how the first example I showed above works. The CSI code has things like this:
[[span style="border: 1px solid silver; font-weight:bold; padding: 7px"]][/{$category}:new-{$category}/edit/true/parentPage/{$page}/title/%20 Create a new {$label}][[/span]]
Which is a neat way of creating child pages in autonumbered categories, but that's another story.
You can see the modules I've already assembled at http://modules.wikidot.com. Feel free to try these. They are all being used, already, on this site, on the Iron Giant templates, and elsewhere.
CSIs make it very easy to pull code into your site and then never worry about maintaining it. The only downside is that you can't customize the code except by forking it and creating your own versions. When the author releases a new version of the CSI, your sites will immediately get the new version. If you want to discuss and improve an existing userspace module, head over to the projects forum.
To end with, we've made a Navigator tool (still beta, but already useful). Here's how to get the beta Navigator tool in your site in 30 seconds. First, edit the top menu to add:
* [/system:navigator Manage pages]
And then create system:navigator with this one line of code: [[include :modules:include:12 page=system:navigator]].
Update: to use the Navigator you do need a compatible stylesheet. If you're not using a Rainbow or Minimalist theme, please see the instructions on the Navigator page.
Wow… Wikidot has come so far. This is going to be a tremendous help and reduce all the manual duplication of code on my sites.
This is so great!! I'm so excited!!! I can't wait to use the CSI!
Thanks, I have been looking forward to cross site includes for a while now.
I think it is a very important and useful addition to the Wikidot module suite.
Wayne Eddy
Melbourne, Australia
LGAM Knowledge Base
Contact via Google+
As much as I was looking forward to this I didn't think of the negatives till now so I have to ask;
Does this mean someone can do includes from other sites without a site owners permission? Will it expose pages from private sites?
Nope, it does not expose pages from private sites, as far as I can tell. (It actually gives a 500 error, which is not perfect, and which we'll fix.)
Portfolio
The new improvements are so great that make one think: are we close to anything like cross-site backlinks? and listpages (like, selecting everything with the same tag in two different sites)? Just dreaming — but I've learned that the Wikidot fairy grants wishes when one least expects…
Thanks, guys, for the amazing job!
Etnolinguistica.Org
An information hub on South American languages
I think the better option is to just have one site for everything that is related in some way.
With private categories in a public site [ not yet implemented :( ] a single site will meet all of your needs.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Next stop: Miami and New York.
Thanks for this! I'm liking the Page Manager, but it doesn't show up cleanly on my site: all the stuff found in popup windows here http://modules.wikidot.com/include:12 is listed explicitly on the page, making for weird spacing.
It's a CSS issue. You'll want to add this to your custom theme's CSS (I think this catches all the items you need). We're going to have to work on adding CSI instructions for the pieces of CSS needed for some of the userspace modules. This might require breaking up our CSS into several pieces to handle situations just like this. Let us know if this works for you. Using Webdeveloper on your site and adding this to the CSS seems to work fine, but you may want to tweak the colors in the .layout elements to match your site better.
-Ed
Community Admin
Thanks, Ed. That works very well. I haven't used CSS before, but that was simple enough. I tried it out with Web Developer and then added it to a custom theme. I couldn't figure out how to change the color of the sorting texts in the header (Title, Author, etc.), but it's fine as is.
Beyond CSS instructions, it would be great if these includes were somehow configurable. For example, I might not want to choose the items in Page Manager's popup menus or stay with an older version of the CSI-ed page when the author updates it. This could be done by letting each CSI page have several versions on modules.wikidot.com: the mainline version and custom versions that one can choose via the data forms module (once it exists)…?
EDIT: Thanks, Rob. That's just what I was looking for.
You could add another line to your CSS (at the bottom) as follows to set the author etc to white:
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Ed, thanks for the answer. I've added better instructions to the module pages. Eventually we'll be able to move all necessary CSS into the module itself.
Portfolio
I tried including from a private site. I expected it to work… but it didn't.
Every time I attempted to save a page that was including from a private site, I got this message:
Every time I attempted to save a page that was including from an open or closed site, it worked perfectly fine.
And something really strange… I changed my private site to closed, added the include (which worked), then changed the site back to private. However, after logging out, clearing cache and refreshing several times, the content still appeared there. What is up with that? :S
This would be really useful. For example, adding this to a private site:
Then including that in a public site… should theoretically only show the menu to those that are also members of the private site. For example, a private site that only admins are a member of.
This could go further… by only showing a comments module on a page if it's an admin looking at the page (e.g. private admin discussion)
It could also lead to showing something completely different based on who visits the page. If you have two groups of users, both a member of WikiA, but split between WikiB and WikiC, then you could do this:
And the two groups of users would see different things (whilst anonymous users would see neither)
Any chance of getting this working? ;-)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I can confirm this behaviour… it does not work on private sites too - to include private site pages on to private site pages…
And I had of course problems with the included pages ( second level ) on this included pages from public sites ( handbook) .
CSI needs a specific design without self including other pages from it's own site with CSI …
This needs a re-structural work
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Possibly. It would mean holding many versions of a page, since there are unlimited combinations (member of sites A and B but not C) in theory, though probably not in practice.
This is similar to the discussion of conditional blocks and hits the same challenges of caching.
I'll discuss it with Michal but IMO this is the wrong way of getting conditional content. I'd be happy that CSIs only work from public sites (if you make them private afterwards, it'll only take effect when you recompile the calling page), and fix the error message so it's clear.
Portfolio
Is it possible to pass data from within a CSI using ListPages? For example. I have pages made using data forms that I then post on the originating site using the ListPages Module. I can put that in say.. the sidebar locally using [[include pagename]] but when I try to call that from another site using a CSI I get nothing.
Example. I put the following code on my pbbg.wikidot.com on a page called sendit
Then on the target site I enter: [[include :pbbg:sendit]] but I all I get is the bit of css formatting with no content in the CSS box.
That means - the ListPages finds no page?
Normally the CSI works like a normal "incldue".
I cannot believe it…
I use all the hammer-navigation codes with CSI - they are all working most with ListPages..
1. Put the CSS in top of the code..
2. the tags="" are strange. !
3. on the target site there is a "textdata:_template" ? ( with data forms I assume? )
Can you show us the 2 pages?
(edit: it would help if you put a stand-alone "source" button om that pages.:
[[button source ]].)
Edit2:
http://pbbg.wikidot.com/sendit does not exist….
Edit3:
my favorite is the strange ( and unused !) tags="" ..!
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
CSI's inject the target page's source into the calling page, not the compiled output of the calling page. That's why the CSS module portion works when injected into your page. What you're looking for is cross-site ListPages. I'm kind of surprised this hasn't come up before. All we would need is a site=site_name option for the ListPages selection criteria. As long as it used the same permissions as CSI, it should be secure enough.
The other option might be using the RSS output from ListPages. I haven't tested this, but it should work for what you're trying to do. The documentation on using the RSS options with ListPages lacks examples. I've found it easiest to create the RSS link and then copy the link that's generated into the Feed module and play with it until I get the results I want.
On your target page:
On your calling page:
(feed src may need editing)
Community Admin
Actually, I've been dreaming about that for a while now :)
http://blog.wikidot.com/blog:cross-site-includes/comments/show#post-621720
Etnolinguistica.Org
An information hub on South American languages
:-) I guess I should have reviewed the old thread before putting my foot in my mouth!
Community Admin
Oha!
I understand now the wish!
He means like a feed the display of the dataform data of the "included" site !
Sorry, this is a real new ( old :) ) dreaming..
Service is my success. My webtips:www.blender.org (Open source), Wikidot-Handbook.
Sie können fragen und mitwirken in der deutschsprachigen » User-Gemeinschaft für WikidotNutzer oder
im deutschen » Wikidot Handbuch ?
Oh is this an old wish? I didn't realize, I'm a little behind in the wikidot curve. I recreated the examples posted above (sorry for the removal) to test it out but from what I understand from the posts above this is a no-go so I think I'll just have to use a version that does not use listpages. I did try the RSS feed version but I think in my case that option does not mesh well with what I'm trying to accomplish.