Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Creating a new field similar to $Content

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

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

Page: 1
Go to End
Author Topic: 1444 Views
  • Pixel
    Avatar
    Community Member
    78 Posts

    Creating a new field similar to $Content Link to this post

    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?

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Creating a new field similar to $Content Link to this post

    Yeah...
    Use a HTMLEditorField.

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

    Good luck !

  • Pixel
    Avatar
    Community Member
    78 Posts

    Re: Creating a new field similar to $Content Link to this post

    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 : )

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: Creating a new field similar to $Content Link to this post

    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 ?

  • Pixel
    Avatar
    Community Member
    78 Posts

    Re: Creating a new field similar to $Content Link to this post

    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.

    1444 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.