Hi all,
I have a template I use to create hundreds of pages that are identical except for the text.
Is there a way I can configure this template through modx to automatically assign the h1 tag to the first paragraph (which is actually the one-line header,) and h2 to the second paragraph, without having to do each page manually? I know it can’t be done via css, so I was wondering if modx could help!
As always, all assistance is appreciated!
- Cris
Sorry, I can’t think of any easy way to do it. The normal method would be to put that line in the LongTitle field and use this in the template:
The only way I can think of would be to write a snippet that would get every resource, move the first paragraph to the longtitle field (and remove it from the content field), and save. This would be fairly easy in Revolution, but a little more difficult in Evolution.
I guess you could also write a plugin to do it on-the-fly. That might be easier, but it would slow down the site.
Thanks Bob!
I think I’ll go ahead and use the longtitle for my header line, and use the <h1>[*longtitle*]</h1> to format it. Now....
Is there a way I can configure that ’summary’ section (or some other area that’s already there) so that I can plug my next paragraph info in there, and then do something like <h2>[*summary*]</h2> with it?
I’m using a template variable for this section right now, but it would be nice to get rid of it if I could.
Thank you for the help!
Cris
Not much to configure I don’t think. Just plug your paragraph into the summary field and use <h2>[*introtext*]</h2>
I’m typing this from memory but I believe that’s the tag for the summary field...
It certainly is. Thanks a million, Bob!
Sorry about that, Mary. I think I need some sack time... Anyway, the introtext worked perfectly. Thank you!
- Cris