481 Posts in 150 Topics by 238 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 1090 Views |
-
parsing content before rendering

6 June 2011 at 10:57pm
Hi there,
Still all new here.. so go gently...Could someone give me a hint on parsing content before i render it?
I would like to have in the content editor something like {specificTag} and then as it's rendered the actual value to be replaced using another function.This is so i can have the user design their table in the content editor and then have it replaced upon render.
Ta.
Grant -
Re: parsing content before rendering

7 June 2011 at 3:41pm
For this I would suggest using short codes. SSBits has a good tutorial on this - http://www.ssbits.com/tutorials/2010/2-4-using-short-codes-to-embed-a-youtube-video/
-
Re: parsing content before rendering

12 June 2011 at 11:18pm
Hi Will,
So i've given that tutorial a go... Am i correct in assuming with short codes you can only parse one variable at a time?
IE, i have a table that looks likeReading number [Weather index]
Date Taken [Weather storedDate]So when i try to import the data into it using the short codes method, i get something that looks like
Reading number 1548 2011-06-12 22:31:10
Date Taken 1548 2011-06-12 22:31:10Thanks
Grant -
Re: parsing content before rendering

13 June 2011 at 2:53pm
Sounds like from your example you would need 2 short codes. One for the reading number, one for the stored date.
-
Re: parsing content before rendering

14 June 2011 at 10:16pm
I thought this, it's just that i would need 14 of them then.
Grant
-
Re: parsing content before rendering

15 June 2011 at 7:24pm
Could pass it as an argument then do a switch in your short code..
[Weather output=storedIndex]
...
public static function YourShortCodeHandler($arguments,$caption= null,$parser = null) {
switch ($arguments['output']) {
case 'storedIndex':
// foo
case 'index'
// bar
}
..
} -
Re: parsing content before rendering

15 June 2011 at 11:07pm
Thanks Will, worked nicely.
Cheers
Grant
| 1090 Views | ||
|
Page:
1
|
Go to Top |


