, Guest!
Already a Member? Login or Register.

Menu



Showcase


Due to the volume of spam happening on our forums, posting is now restricted to verified members only.  If you're not verified, drop us a note with your username.

Home > FlexCMS Support Forum > User Help > General Support Requests > Hiding blocks from some pages

FlexCMS Support Forum


Hiding blocks from some pages
Started August 30, 2006 @ 9:20pm by lionkyng
Post Message 
lionkyng


Posts: 3
 
Hiding blocks from some pagesAugust 30, 2006 @ 9:20pm
I've just started with FlexCMS so I'm just getting to learn all of the Features.
On my home page I have 3 custom blocks with contents. These blocks are showing on every pages whic is not what I want. Is it possible to disable blocks for specific pages?

What is the Page Categories used for?
 
DCSun
Administrator



Posts: 625
 
August 30, 2006 @ 10:34pm
Hi lionkyng,

No, unfortunately there isn't a really easy way to have certain blocks show on certain pages. We've had requests for that feature in the past, and do plan to introduce it in a coming version. Which and when, however, I really can't say at this point.

There is a way that you can do it, which works off of FlexCMS not displaying blocks which have no contents. Essentially you just put a series of IF statements in a block using PHP code, and if the page is one you want the block to appear on, you print out the contents you want there. Here's an example from another site that did this same thing:
Code

if ($Arguments1 == 'pages' && $Arguments2 == 'index') {
print 'Home Page Block';
}
else if ($Arguments1 == 'articles') {
print 'Articles Block';
}
else if ($Arguments1 == 'pages' && ($Arguments2 == 'contact' || $Arguments2 == 'contact_submit')) {
print 'Contact Page Block';
}


Hopefully that's enough to point you in the right direction. If not, give us some more details on what exactly you're trying to accomplish and we'll see what we can do to help you.

As for page categories, those are there to assist in your organization of the various pages on your site. You might find that useful as you start adding more and more pages to your site, scheduling certain ones for certain dates and times, etc. They aren't displayed on the public site, only in the pages administration area.


David


FlexCMS v3.2 Has Been Released!
 
lionkyng


Posts: 3
 
Hiding blocks from some pages September 3, 2006 @ 7:03pm
Hello David,
thanks for the suggestion.
Not sure if I fully understand what you are saying, this is what I have done.
created and enabled a block called 'Home Page Block'
I added the code you suggested into my index page and turned on php. I would have expected to see the block on the index page only but this is not the case...but I'm not sure where the code should be placed. I'm by no means a php programmerSmile

this is what i'm trying to do...
I have a javascript function I do not want my customers messing with so I put it in a custom block at bottom center below the page content.

This block should only be enabled (visible) on the index page and disabled every where else.

I could make the javascript part of the index page's content but it may be accidentally edited.

many thanks
lionkyng
 
DCSun
Administrator



Posts: 625
 
September 4, 2006 @ 12:04am
Sorry for the confusion. The code should be placed in the block you wish to turn on and off, along with the actual block contents you want displayed. The IF statement determines which pages it's displayed on, and optionally what block contents would go on what pages.

So if you want it to display only on the index page, you would do something like this:

Code

if ($Arguments1 == 'pages' && $Arguments2 == 'index') {

print '<script>your javascript code here</script>';

}



David


FlexCMS v3.2 Has Been Released!
 

Post Message 




Try & Buy FeedForAll - Easy to use RSS Feed Creator - great for iTunes users!

MEMBERS




All Contents, Code, Scripts and Technologies Copyright 2003-2009 FlexCMS.
All Rights Reserved. Software License Agreement

Processing Time: 0.07382 seconds.
 
Management Login

Powered By FlexCMS
Powered By FlexCMS