Fixed Rotating Sidebars

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
Trekk69
New Member
New Member
Posts: 4
Joined: Sun Jul 01, 2012 2:27 pm

Fixed Rotating Sidebars

Post by Trekk69 »

Hello,
We had our website redesigned using the CMS as the backbone, but now my boss has asked me to update a few things...I have accomplished all of his requests but one:

We have rotating testimonials on the homepage and various service pages that randomly rotate, however on the Speaking tab (http://www.millington.ca/index.php?page=speaking) we want the testimonials on the right to be fixed between two or three that are focused on speaking (and not on the other services).
I have tried playing around (I have full admin access) but cannot seem to find anything where I can select what side bar items to be shown.

Any help would be appreciated.

Thanks
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Fixed Rotating Sidebars

Post by Dr.CSS »

You would have to tell us how you get content into that side bar and a lot of other info for us to figure out how to help you, what module is it, how is it called(in page or template), etc. etc....
Trekk69
New Member
New Member
Posts: 4
Joined: Sun Jul 01, 2012 2:27 pm

Re: Fixed Rotating Sidebars

Post by Trekk69 »

Thank you very much.
Where I go to add new testimonials (that are then randomly chosen) is under Content -> Global Content Blocks -> Add new
I looked under the "Options" tab under a Page that I was editing to see if I could find any reference back to the Global Content in the code, but I could not.
The "Tags" associated with each testimonial is as such :{global_content name='testimonial Chris Bart'}
The template is default and says 1.10.3 "Hyacinthe" at the bottom.

Anyway, hopefully this helps...I admit, I am slowly learning this.

Thanks in advance
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1788
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Fixed Rotating Sidebars

Post by DIGI3 »

If the global content blocks that you wish to display follow a naming convention, you can use a regex to limit which ones are randomly displayed:

{random_gcb delimiter='' block_regex="^foo"}

The above example would randomly show any gcb beginning with "foo" such as foobar, foofighters, foodforthought, but would skip the rest.
Trekk69
New Member
New Member
Posts: 4
Joined: Sun Jul 01, 2012 2:27 pm

Re: Fixed Rotating Sidebars

Post by Trekk69 »

Thank you DIGI3.
Where would I post the regex code? on the page I want to restrict the sidebars?
Thanks again
User avatar
DIGI3
Dev Team Member
Dev Team Member
Posts: 1788
Joined: Wed Feb 25, 2009 4:25 am
Location: Victoria, BC

Re: Fixed Rotating Sidebars

Post by DIGI3 »

Typically tags would go in your template. You will probably want some {if}{else} tags to determine which pages get what sidebars. The CGSimpleSmarty module will also make this process easier. Here's an example from one of my templates:

<div id="sidebar">{if $cgsimple->get_root_alias() == 'products'}{random_gcb delimiter='' block_regex="^products_"}{else}{random_gcb delimiter='' block_regex="^services_"}{/if}</div>

So any page under the products page in site hierarchy will display a random gcb starting with products_, any other page in the site will show one starting with services_.
Trekk69
New Member
New Member
Posts: 4
Joined: Sun Jul 01, 2012 2:27 pm

Re: Fixed Rotating Sidebars

Post by Trekk69 »

Great thanks.
I will check out that module and proceed as suggested.
Thanks again for your help.
Post Reply

Return to “The Lounge”