I have a page named "1.0" that uses the Expand and Include Page macros to show a child page named "A Child 1.0"while staying in the parent page. Works nicely. But now I copy the parent page to a new page named "1.1" and the child page to "A Child 1.1". I have to edit the new parent page so it doesn't include the old "A Child 1.0" page. This is quite a bit of work when there are many children. I don't want to use a new space for each version.
So the question is whether there's any way to use a variable in the name of the page to be included? I want to say "Expand: Include Page: A Child %myvar%" and then define %myvar% somewhere on the parent page.
I've poked around the open issues for this at JAC, didn't see any progress on them there.
~Matt
I think the easiest thing to do is create a user macro with the other macros inside. That way you can set a parameter in the macro browser and that parameter can set the variables.
Or you can add variables to templates. If you create a page from a template you can add your values to the variables before the page is initially built.
Could you expand on this?
I've tried the 2nd option you suggest. Using the "Create from Template" macro to call my own template that has variables you select for the page title. But when it builds the page the title isn't filled out.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Matt,
As Bob suggests, the Reporting plugin (by your own company) will be able to pick out a variable created on the parent page, in the form of a scaffold field. You can then inject this into the include macro. Alternatively you could take the name of the current page and inject that. The mark up will be something similar to this (untested):
{report-on:injected=true} {include:A child %page:title%} {report-on}
Hope that helps,
Charles
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You could use the Run-now macro and the $page_title pre-defined variable to construct the child title. That will work for simple concatenation for child names. Otherwise, you would need a script or something else. The reporting plugin might have something similar as well.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.