2

I've been asked to add templates (where a blog post is pre-created with certain content) and the user simply selects it and make minor changes. Please note this is not a visual template, but a content one.

Thanks!

1
  • if you are asking about the content type then, make node tpl for that content type. – harsh_behl_0007 Sep 14 '15 at 8:44
1

Go to Manage fields

Ex: /admin/structure/types/manage/article/fields

Then click on edit, for example, the body field. Look for Default Value and put whatever you want there.

Now when a user tries to add a new article, it will have the body pre-filled-out and they can change it if they wish.

2
  • Would it be possible to have more than one? For instance, a template for each occasion? – WagnerMatosUK Sep 14 '15 at 12:43
  • you would then need to create a content type for each occasion. – No Sssweat Sep 14 '15 at 23:52
0

You can theme template by content type. You need to create a node--blog.tpl.php and write your code in here. Check out this link for more info.

https://www.drupal.org/node/17565

3
  • Thanks mate, but that's not what I meant. What I want is, when the user adds a new blog post for instance, when the user hits create content, the blog will be pre-populated with some content and the user will only update this content. Does that make sense? – WagnerMatosUK Sep 14 '15 at 10:15
  • Ok. I suggest you may use the hook_form_alter then for your content type form and prepopulate the fields based on the logged in userid or from his profile fields. You may refer this answer here – Kapil Ropalekar Sep 14 '15 at 10:27
  • That'd roughly what I'm looking for but I'd prefer something that the user can edit the templates (no code knowledge required sort of thing) – WagnerMatosUK Sep 14 '15 at 10:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.