A better way of registering a block tags?

For questions and problems with the CMS core. This board is NOT for any 3rd party modules, addons, PHP scripts or anything NOT distributed with the CMS made simple package itself.
Locked
mahjong

A better way of registering a block tags?

Post by mahjong »

Hi. I'm running CMS Made Simple 0.13 Canary.

I wanted to register a block tag :

Code: Select all

{my_tag} ... {\my_tag}
CMS Made Simple doesn't seem to be designed to accept them natively. There is no hook like for function tags. So, I've modified the source code of lib\content.functions.php. I've added the block type in the plugins registering loop :

Code: Select all

Near line 671 : 
  $types=array('function','compiler','prefilter','postfilter','outputfilter','modifier','block');

Near line 710 :
  case 6: $smarty->register_block($file, "smarty_cms_block_" . $file); break;
Now, I can create block.my_tag.php in the plugin folder, the same way as for regular function tags, function.my_tag.php. I works, but on next update of CMS Made Simple, I'll to edit once again lib\content.functions.php.

Is there a better way of registering block tags, without hacking CMS's core? Maybe with a module?
Last edited by mahjong on Mon Jun 12, 2006 7:20 pm, edited 1 time in total.
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: A better way of registering a block tags?

Post by Ted »

This is a reasonable change.  I'm just going to commit it into svn and it'll be in the next release.  :)

Thanks!
mahjong

Re: A better way of registering a block tags?

Post by mahjong »

Wow! Thank you.
Ryno

Re: A better way of registering a block tags?

Post by Ryno »

Hey guys,

Sounds really interesting but I have no idea what you both are talking about?

Can one of you give an example of when you'd need a block tag, as well as what a block tag is?

Sorry, I'm still learning my Smarty ABC's...

Ryno
Ted
Power Poster
Power Poster
Posts: 3329
Joined: Fri Jun 11, 2004 6:58 pm

Re: A better way of registering a block tags?

Post by Ted »

Say you want a tag that does something on a block of text.  Like, {literal}whole bunch of stuff that should be escaped{/literal}.  http://smarty.php.net/manual/en/plugins ... ctions.php

Keep in mind that this isn't user defined tags in the admin, but tags created in the /plugins directory.
Locked

Return to “CMSMS Core”