Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

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.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo

Creating a new field similar to $Content


Go to End


5 Posts   1759 Views

Avatar
Pixel

Community Member, 78 Posts

31 May 2008 at 12:03am

Edited: 03/06/2008 11:43pm

Hi, I am currently working on my first CMS website using SS and at the moment I do not have a great knowledge of PHP.

I am trying to create a new field which I want to use for a specific page type (an article holder) that would allow me to add an image to it just like $Content

Any ideas?

Avatar
Fuzz10

Community Member, 791 Posts

31 May 2008 at 8:05am

Yeah...
Use a HTMLEditorField.

See : http://doc.silverstripe.com/doku.php?id=htmleditorfield

Good luck !

Avatar
Pixel

Community Member, 78 Posts

3 June 2008 at 11:38pm

Ok that does seem to be what I am looking for but where would i place the snippet of code in my headlinearticlepage.php file, would i need any other code as well and where would that go.

So basically what i am trying to do is create a headline news item which sits at the top of my article holder page with the other stories below. This headline story will sit in its own div with an image to the left and the article headline, sub-header, date and content paragraph to the right of the image. So the other HTMLEditorField that i want to add will be where I insert the image so i can draw from it separately to the $content feild.

Does this sound like a feasible idea/method of approach?

Hope that makes sense : )

Avatar
Fuzz10

Community Member, 791 Posts

4 June 2008 at 12:17am

Sounds like you need to take a thorough look the tutorials. ;-)

Isn't it enough adding a separate imagefield to your holderpage to get the result you want ?

If I understand correctly, you want to create a list of news-items with 1 main (feature)-article on top of that page ?

Avatar
Pixel

Community Member, 78 Posts

4 June 2008 at 2:03am

Edited: 04/06/2008 2:04am

Ok, ok, my bad. 2 cut a long story short I skipped the staff tutorials because I worked through them last year but couldn't grasp making a template so left SS until recently, and then i only did the tutorials i thought relevant.

Excuses eh!

But thanks for the push in the right direction - much appreciated. And yes thats correct.