Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Get every single line of excerpt
Hey guys, I am tying to find a way to let the user in the backend add different dates to an article.
I was thinking to let him put in the excerpt something like this:
12-11-2020 11.30. a.m.
12-11-2020 4.30. p.m.
13-11-2020 10.00. a.m.
13-11-2020 1.00. p.m.
What would be a clever way to split this entry so that I could access each day (+time) seperately?
Offline
Re: Get every single line of excerpt
With the risk of stating the obvious – could you use custom fields instead? There is a factory limit of 10, is that enough?
Offline
Re: Get every single line of excerpt
I wanted to avoid using custom fields because I am not sure if 10 will be enough and it will blow up the backend by so many fields. I thought it would be more elegant to let the user put his data in an “by line” basis. But thank you anyway for trying to help.
Offline
Re: Get every single line of excerpt
I just found adi_list
I will give it a try and let you know if that worked fine for me.
Offline
Re: Get every single line of excerpt
In the end I went with a combination of pax_grep and rah_repeat to build a selectbox from each line of my excerpt:
<txp:variable name="options">
<txp:pax_grep delimiter="|" from="/<\/?p>/|/\t/|/<br\s*\/?>/" to="||,">
<txp:excerpt/>
</txp:pax_grep>
</txp:variable>
<select name="somename" id="someid">
<txp:rah_repeat trim="1" value='<txp:variable name="options"/>'><option value="<txp:rah_repeat_value />"><txp:rah_repeat_value /></option></txp:rah_repeat>
</select>
Maybe somebody has a prettier idea?
Offline
Pages: 1