Page 1 of 1

how to import content from parent page into a child page

Posted: Wed Oct 08, 2014 10:50 pm
by newagekat
Hello:

we are using cmsms v1.11.7. On our collection pages we have 4 tabs. the first tab shows color swathes associated with a sub pages. when a user clicks on a swatch, we want the content of the swatch page, which uses tags from content utility mod, to be inserted in a tab between the 1st and 2nd tab of the collection page

example
1.0 collection (section header)
1.1 collection A
1.1.1 color 1
1.1.2 color 2
1.1.3 color 3
1.2 collection B
etc.

collection A
tab 1
tab 2
tab 3
tab 4

when swatch is clicked on tab 1, the tabs rearranges like this
Collection A
tab 1
color tab - brings content from color page
tab 2
tab 3
tab 4

is it best to replicate the tabs from the collection page with their content on each color page or can the color page be inserted into a tab that is only visible when the color swatches are clicked?

See attached screen shot

any suggestion is much appreciated.

Re: how to import content from a child page into a tab

Posted: Thu Oct 09, 2014 9:00 am
by velden
Read this: https://www.cmscanbesimple.org/blog/mul ... query-tabs
Show/hide the specific tabs with javascript.

You can use an Ajax approach too, but it will be more complex.

(duplication is not a good idea I think)

Re: how to import content from a child page into a tab

Posted: Fri Oct 10, 2014 5:24 pm
by newagekat
Veiden

I'm using tabbeetab in my template.

I have read Rolf's article, but he hard codes the sub-page tabs. Would your suggestion work if I wanted to dynamically load a tab between 2 existing tabs depending on the link clicked on tab 1? These links are a modified menu template.

See image below. I'm no coder, suggestions are very welcome. Thank You!

Re: how to import content from a child page into a tab

Posted: Thu Oct 30, 2014 8:25 am
by Jeff
Yes, javascript/jQuery can load the content from a link into a tab or add tabs.

If you don't know enough about AJAX with jQuery you might want to hire someone to code it.


Jeff

Re: how to import content from a child page into a tab

Posted: Fri Oct 31, 2014 6:54 am
by newagekat
Jeff
Thanks, that's what I thought. Slight change in approach following a meeting.

I'm using multiple content blocks with assigned variables to show/hide tabs based on whether there is content in the block on a parent page template.

the first and last tabbed content needs to be called into a child page in the same position (first & last). So the logic would be something like:

if current page is a child, then show $tab1 content of parent page as the first tab and (for example) $tab4 as last tab.

I'm fishing right now cause i first have to re-template the site to be responsive to various devices. Need time to get my head around this.

thanks for your input. If you can outline a method, I have no issues with hiring :D

Re: how to import content from a child page into a tab

Posted: Sat Nov 01, 2014 1:08 am
by paulbaker
newagekat wrote:the first and last tabbed content needs to be called into a child page in the same position (first & last). So the logic would be something like:

if current page is a child, then show $tab1 content of parent page as the first tab and (for example) $tab4 as last tab.
You could probably do this with CGSimpleSmarty. Check out functions like get_parent_alias and get_page_content which enable you to grab content blocks from other pages. Neat. :D