0

I would like site announcements to appear in a block on the sidebar.

I can do that with a content type, but Admin has a blog and I was wondering if/how to automatically give all blog posts of Admin (and no other user) be of a content type

2

I think what you want is to create a view. Show all blog entries by 'user 1' only in your block. Create a view: Under your display(on the left) select block from the drop down. Give it a name, say Test1. Under Fields add Node:Title and Node:Body. In the filters add Node-type:Blog, Node:Published:Yes and User:Name=Admin

Then goto Site building->Blocks and you should see Test1:Viewname. Enable that block and configure it to show it on the page where you'd like.

Hope that helps.

| improve this answer | |
  • +1 but, alas, not the answer yet. As you can tell, I am a n00b. I have just been reading about views in my Drupal book and should have known that. Thanks for reminding me. Unfortunately ... – Mawg says reinstate Monica Nov 16 '11 at 23:53
  • When I try to create such a view I get a message about invalid SQL - which I would never expect to happen as Drupal is generating the SQL for me??!! If I try to create a view with User Id = 1 then I get SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '= '1') ))) subquery' at line 1 – Mawg says reinstate Monica Nov 16 '11 at 23:54
  • at the bottom of admin/structure/views/view/site_announcements same sort of thing if I try author=Admin Should I be reporting this is a bug? Maybe in the Views module? – Mawg says reinstate Monica Nov 16 '11 at 23:56
  • Hi, I don't think its a bug :) Could you post the steps you did.. I'm updating my answer to be more specific – zarsiwala Nov 17 '11 at 18:09
  • There was an update to the views module this morning and suddenly it works. Thanks for all of your help – Mawg says reinstate Monica Nov 18 '11 at 0:24

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.