Fruml CMS Community: Repository Update - Fruml CMS Community

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Repository Update

#1 User is offline   Alex Icon

  • Author
  • Icon
  • Group: Administrators
  • Posts: 56
  • Joined: 17-January 10

Posted 17 February 2010 - 09:30 PM

Just committed the Custom Tag functionality to Mercurial repository at BitBucket.
Custom tags allow you to create shortcuts for things you often use in your pages and templates. There are two types of custom tag:

Literal Tags
Literal tags are replaced in your content as is. For example:
Tag: :-) 
Replacement: <img src="[setting name="base_url"]asset/img/smileys/happy.png" width="16" height="16" alt="Smiley!" />

Result: when a page is rendered, any instances of :-) will be replaced with an image tag containing a smiley :)

Regular Expression Tags
These are a little more difficult, as certain characters need to be escaped in the tag, but you can then do some pretty cool stuff. Example:
Tag: {[(.*?):(.*?)]}
Replacement: [media name="$1" tag="true" transform="$2"]
In your content: {[MyMediaItemName:MyImageTransformation]}

Result: In your page, the above tag would be replaced by your media item, after it's been transformed using the transformation given as second argument.

Of course, until the image transformation stuff is finished the above example isn't very good, but it shows how the custom tags work.
Theoretically you could create a bunch of custom tags so that you never have to use a single Fruml tag at all. ;)

Custom tags are enabled by default, but I will add an option to disable them to the settings page. By turning them off you gain a little speed, but lose a lot of flexibility...
0

#2 User is offline   Far Icon

  • Member
  • PipPip
  • Group: Members
  • Posts: 24
  • Joined: 04-February 10

Posted 18 February 2010 - 12:23 AM

Interesting idea, it will be very usefull.)
0

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users