how to import content from parent page into a child page

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
newagekat
Forum Members
Forum Members
Posts: 161
Joined: Mon Feb 06, 2006 6:06 pm

how to import content from parent page into a child page

Post 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.
Attachments
preview of collection page
preview of collection page
Last edited by newagekat on Wed Nov 19, 2014 3:11 am, edited 1 time in total.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3483
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

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

Post 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)
newagekat
Forum Members
Forum Members
Posts: 161
Joined: Mon Feb 06, 2006 6:06 pm

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

Post 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!
Attachments
tabbedContent.png
Jeff
Power Poster
Power Poster
Posts: 961
Joined: Mon Jan 21, 2008 5:51 pm
Location: MI

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

Post 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
newagekat
Forum Members
Forum Members
Posts: 161
Joined: Mon Feb 06, 2006 6:06 pm

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

Post 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
User avatar
paulbaker
Dev Team Member
Dev Team Member
Posts: 1465
Joined: Sat Apr 18, 2009 10:09 pm
Location: Maidenhead, UK
Contact:

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

Post 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
Post Reply

Return to “The Lounge”