HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


BLOCK_main_only_if_match?

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#29028 (In Topic #6657)
Avatar

Community saint

BLOCK_main_only_if_match_DESCRIPTION=Shows the given caption only if the page matches one of the match tags.

what exactly this does this block do?
Back to the top
 
Posted
Rating:
#29057
Avatar

Code

[block="_WILD:_WILD:foo=1" caption="You have foo=1 in the URL"]main_only_if_match[/block]

[block="forum:topicview" caption="You are viewing the topicview module in the forum zone"]main_only_if_match[/block]

In action


You are viewing the topicview module in the forum zone

It's very useful for panels – you could make things only appear in certain site positions.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29058
Avatar

Now go to this URL:
http://ocportal.com/forum/pg/topicview/misc/6657/index.php&start=0&foo=1

You'll see my post above changes, because then the URL will match both match tags, not just the second.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#29110
Avatar

Community saint

Sometimes I regret I am not a coder but a filologist  O_o
It took some time for me to realize this.

First question: Where did you write the name of the block "In Action". Aaaah, these are lines, but not actual blocks as usual, arent they?

As far as I understood this feature can be used for target advertising. Lets say in my cedi I have several pages, but I want certain banners to appear at certain articles.
So I put this code somewhere in cedi's template and write there some mach tags (page ID's or better Names). and ads appear in where they have to, right?

I use phpAdsNew for advertising. So I have to put it's code in to the caption.
Back to the top
 
Posted
Rating:
#29120
Avatar

Where did you write the name of the block "In Action". Aaaah, these are lines, but not actual blocks as usual, arent they?

If you want to see exactly what I typed in my post, click the quote button and you'll see all my code in quote tags.

So I put this code somewhere in cedi's template and write there some mach tags (page ID's or better Names). and ads appear in where they have to, right?

Yeah. But from Tempcode you use blocks differently.

Here's the Tempcode version of my first example:

Code

{$BLOCK,block=main_only_if_match,param=_WILD:_WILD:foo=1,caption=You have foo=1 in the URL}


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: