I have two home pages (default, home). Which one opens depends on the user. But the subpages (content) are the same for both of them.Is it ok if I have the following structure in Umbraco?
Content
default
home
about
products
contact
...
If I use macro, will both home pages (default and home) read from subpages?
well, you don't have subpages on the default node, so iterating child nodes when on that page doesn't make sense... as you don't have any.
If you have the same content for both home pages, I'd suggest to introduce another page on the same level of default and home (let's call that one 'Pages' and move all childnodes of 'home' node under the node 'Pages' node). From there on, write your xslt macro to list child nodes of the 'Pages' node, and that macro can then be used on both the 'default' and 'home' node.
Or, if you'd like to keep the existing structure, create a macro that accepts a parameter of type 'content picker' and use that macro on the templates for both 'home' and 'default' page and set it to 'home' node. Macro and xslt will then use that parameter value to list all subnodes.
I'm getting little lost.I'm new to Umbraco and pretty new to XSLT. If i understand you, macro will read all the nodes of the "Pages". What do you mean by that that macro can be then used on "default" and "home" node? Maybe stupid question - how do I use macro on node? So far I used macros in templates.
The macro should be something like the macro from Blog, which lists child nodes. Am I close?
Two "main" pages question
Hi,
I have two home pages (default, home). Which one opens depends on the user. But the subpages (content) are the same for both of them.Is it ok if I have the following structure in Umbraco?
Content
default
home
about
products
contact
...
If I use macro, will both home pages (default and home) read from subpages?
THX for your help
Uros
well, you don't have subpages on the default node, so iterating child nodes when on that page doesn't make sense... as you don't have any.
If you have the same content for both home pages, I'd suggest to introduce another page on the same level of default and home (let's call that one 'Pages' and move all childnodes of 'home' node under the node 'Pages' node). From there on, write your xslt macro to list child nodes of the 'Pages' node, and that macro can then be used on both the 'default' and 'home' node.
Or, if you'd like to keep the existing structure, create a macro that accepts a parameter of type 'content picker' and use that macro on the templates for both 'home' and 'default' page and set it to 'home' node. Macro and xslt will then use that parameter value to list all subnodes.
Does that make sense?
Cheers,
/Dirk
THX Dirk,
I'll go with the first suggestion. I'll get back to you to let you know how it goes. THX again.
Uros
I'm getting little lost.I'm new to Umbraco and pretty new to XSLT. If i understand you, macro will read all the nodes of the "Pages". What do you mean by that that macro can be then used on "default" and "home" node? Maybe stupid question - how do I use macro on node? So far I used macros in templates.
The macro should be something like the macro from Blog, which lists child nodes. Am I close?
THX for your patience
Uros
Found this tutorial. Looks like something I'm looking for. Am I right?
http://umbraco.org/documentation/books/re-use-content
Except the part where they are talking about limitations. I'm going to use DOC2Type on "Contact"
Hi Uros,
Sounds like a good solution to your "problem". Good luck with it and don't hesitate to ask more questions if you still have some.
Cheers,
/Dirk
is working on a reply...