I'm currently using a content input box to manage a list of links. There are two sets of links, each with a separate heading. At the moment, my client must edit the html to use the correct DIV style, formatting the links correctly. Is there a way to automate this so that links are automatically given the correct div styling?
Any help is much appreciated for this silverstripe beginner! Thanks
We've moved the forum!
Please use forum.silverstripe.org for any new questions
(announcement).
The forum archive will stick around, but will be read only.
You can also use our Slack channel
or StackOverflow to ask for help.
Check out our community overview for more options to contribute.
I'm seeing some issues with that page, where your user is surrounding the links with H1 headers now? that can't be right :)
Could you provide us with a correct example of how the user is actually supposed to format link and header?
Thanks for the reply Martimiz. That is actually my own styling, I'm sure you are right — the current method of styling is a bit of a mess. The current layout and style is correct however, we just need to sort out the backend. Ideally I'd just like to have two content input boxes so that the user can simply add a link and it will be automatically styled using predefined terms. Is this possible? Thanks again!
Easy way: define a new HTMLText databasefield 'content2' in your pages $db array, and add a HTMLEditorField for it in your pages getCMSFields() function. Tell the user to just add links to them, nothing else :)
Then in your page template something like
<h2>title 1</h2>
<div id="FirstLinkset">$Content</div>
<h2>title 2</h2>
<div id="SecondLinkset">$Content2</div>
Then just style #FirstLinkset a and #SecondLinkset a