When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it.
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course).
Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page?
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
Well not every home page on the internet is a teaser list. This particualar one has a random image (thanks for your help on that btw I got it working), two paragraphs of text that are only on that page, a specialized search (custom module) and 3 news items. The news items will just be headers that link. However the two paragraphs don't link off anywhere, so you can't see them anywhere except the homepage. Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
Metzler, David wrote:
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course).
Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page?
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
Do you have $tabs included in the home page template?
sander-martijn wrote:
Well not every home page on the internet is a teaser list. This particualar one has a random image (thanks for your help on that btw I got it working), two paragraphs of text that are only on that page, a specialized search (custom module) and 3 news items. The news items will just be headers that link. However the two paragraphs don't link off anywhere, so you can't see them anywhere except the homepage. Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
Metzler, David wrote:
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course).
Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page?
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Yes I do. And the edit/revisions tabs appear on the other pages. (that was a good question though - my first try at a template didn't include tabs and i was missing all kinds of things)
Sarah Adams wrote:
Do you have $tabs included in the home page template?
sander-martijn wrote:
Well not every home page on the internet is a teaser list. This particualar one has a random image (thanks for your help on that btw I got it working), two paragraphs of text that are only on that page, a specialized search (custom module) and 3 news items. The news items will just be headers that link. However the two paragraphs don't link off anywhere, so you can't see them anywhere except the homepage. Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
Metzler, David wrote:
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course).
Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page?
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
Last I checked, node Title was a required field, and by default, the node title on a home page displays with a link to that piece of content. So how are you suppressing them for the two paragraphs. Are you using panels? Are you supressing the the titles via custom tpl's for specific node types (e.g. story.tpl)? Are these blocks with custom text? Have you customized node.tpl, story.tpl or another .tpl file to remove titles?
As one person has suggested, adding the edit link at the theming layer with tests on which "role" a user is in, is one way to add specific links to editing a node on the page. Could you include more info about how your paragraphs are constructed?
Dave
________________________________
From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 4:07 PM To: support@drupal.org Subject: Re: [support] Change home page from story to page?
Yes I do. And the edit/revisions tabs appear on the other pages. (that was a good question though - my first try at a template didn't include tabs and i was missing all kinds of things)
Sarah Adams wrote:
Do you have $tabs included in the home page template? sander-martijn wrote:
Well not every home page on the internet is a teaser list. This particualar one has a random image (thanks for your help on that btw I got it working), two paragraphs of text that are only on that page, a specialized search (custom module) and 3 news items. The news items will just be headers that link. However the two paragraphs don't link off anywhere, so you can't see them anywhere except the homepage. Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content. Metzler, David wrote:
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course). Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question. Dave -----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page? When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
-- ------------------------------------------------------------------------ sander-martijn mailto:sander@sander-martijn.com mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com http://www.sander-martijn.com ------------------------------------------------------------------------
I'm using node.tpl.php to rewrite the content like this: <div> <h2><?php print $title ?></h2> <div class="content"><?php print $content ?></div> </div>
So that I don't have the header link bc i don't want the content to show anywhere other than the home page. Thanks everyone for giving me several different options to try. At the moment, for my needs it seems like the best option to get what i need would be to change node.tpl.php so that it links the title like normal if you're an admin. Furthermore I should probably only retheme stories until i get a better handle on the different options.
Metzler, David wrote:
Last I checked, node Title was a required field, and by default, the node title on a home page displays with a link to that piece of content. So how are you suppressing them for the two paragraphs. Are you using panels? Are you supressing the the titles via custom tpl's for specific node types (e.g. story.tpl)? Are these blocks with custom text? Have you customized node.tpl, story.tpl or another .tpl file to remove titles?
As one person has suggested, adding the edit link at the theming layer with tests on which "role" a user is in, is one way to add specific links to editing a node on the page. Could you include more info about how your paragraphs are constructed?
Dave
*From:* support-bounces@drupal.org [mailto:support-bounces@drupal.org] *On Behalf Of *sander-martijn *Sent:* Monday, August 20, 2007 4:07 PM *To:* support@drupal.org *Subject:* Re: [support] Change home page from story to page?
Yes I do. And the edit/revisions tabs appear on the other pages. (that was a good question though - my first try at a template didn't include tabs and i was missing all kinds of things)
Sarah Adams wrote:
Do you have $tabs included in the home page template?
sander-martijn wrote:
Well not every home page on the internet is a teaser list. This particualar one has a random image (thanks for your help on that btw I got it working), two paragraphs of text that are only on that page, a specialized search (custom module) and 3 news items. The news items will just be headers that link. However the two paragraphs don't link off anywhere, so you can't see them anywhere except the homepage. Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
Metzler, David wrote:
Doen't quite make sense. The home page is normally a "teaser list" of nodes. If you click on the node that you want to edit, whether it's the top sticky one or another, you should be able to edit that node, (provided you have permissions of course).
Not sure what you mean by "go looking for it", so am a little confused as to whether I'm answering your question.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of sander-martijn Sent: Monday, August 20, 2007 1:32 PM To: support@drupal.org Subject: [support] Change home page from story to page?
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed? I do want the home page to have other elements such as news stories that have been promoted to the home page, so maybe this is the only or best way to do it. but i think the best case would be for an editor to be able to edit the main home page content from there rather than to have to go looking for it. -- [ Drupal support list | http://lists.drupal.org/ ]
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
--
sander-martijn mailto:sander@sander-martijn.com interface developer | architect sander@sander-martijn.com mailto:sander@sander-martijn.com www.sander-martijn.com http://www.sander-martijn.com
My solution for now was to change node.tpl.php to have this at the top: <?php global $user; $approved_roles = array('superuser', 'editor'); ?>
and in the header area: <?php if (is_array($user->roles)) { if (count(array_intersect($user->roles, $approved_roles)) > 0){ ?> <h2><a href="<?php print $node_url ?>" title="<?php print $title ?>"><?php print $title ?></a></h2> <?php }else{ ?> <h2><?php print $title ?></h2> <?php }} ?>
Thanks to the help on this list and the info on this page: http://drupal.org/node/104444
Now if you're not an admin it doesn't link to the page, but if you are it does so you can edit it. The only concern I really have about this solution is maintenance - right now there are only the above listed roles for admin editing. However if we add "manager", "content producer" etc, then a change has to be made to node.tpl.php every time that happens. That is of course not ideal for a single use template like this and would be completely unworkable for a reusable template.
Anyone know of a way to query whether the user has edit rights on the node (no matter what their role) instead of whether they're in a particular role? Then I could rewrite this in a way that is more maintainable.
thanks .sander
sander-martijn wrote:
I'm using node.tpl.php to rewrite the content like this:
<div> <h2><?php print $title ?></h2> <div class="content"><?php print $content ?></div> </div>
So that I don't have the header link bc i don't want the content to show anywhere other than the home page. Thanks everyone for giving me several different options to try. At the moment, for my needs it seems like the best option to get what i need would be to change node.tpl.php so that it links the title like normal if you're an admin. Furthermore I should probably only retheme stories until i get a better handle on the different options.
Metzler, David wrote:
Last I checked, node Title was a required field, and by default, the node title on a home page displays with a link to that piece of content. So how are you suppressing them for the two paragraphs. Are you using panels? Are you supressing the the titles via custom tpl's for specific node types (e.g. story.tpl)? Are these blocks with custom text? Have you customized node.tpl, story.tpl or another .tpl file to remove titles?
As one person has suggested, adding the edit link at the theming layer with tests on which "role" a user is in, is one way to add specific links to editing a node on the page. Could you include more info about how your paragraphs are constructed?
Dave
sander-martijn schrieb:
Anyone know of a way to query whether the user has edit rights on the node (no matter what their role) instead of whether they're in a particular role? Then I could rewrite this in a way that is more maintainable.
As I wrote in my previous post: node_access('update', $node) will check if you (the current user) has the right to update (eq. "edit") the given node.
hth,
Stefan
oh thanks! missed that in the (wonderful) flurry of responses I got. That works, and makes me a lot happier about the code. .s
Stefan Borchert wrote:
sander-martijn schrieb:
Anyone know of a way to query whether the user has edit rights on the node (no matter what their role) instead of whether they're in a particular role? Then I could rewrite this in a way that is more maintainable.
As I wrote in my previous post: node_access('update', $node) will check if you (the current user) has the right to update (eq. "edit") the given node.
hth,
Stefan
Quoting sander-martijn sander@sander-martijn.com:
Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
If you have access you should be able to click on the title and bring up the page with an edit tab.
Earnie -- http://for-my-kids.com/
Earnie Boyd schrieb:
Quoting sander-martijn sander@sander-martijn.com:
Therefore to edit them you need to go to the content management part of the admin and find the story and edit it. I was just wondering if there was an easier way to have the editors manage the home page content.
If you have access you should be able to click on the title and bring up the page with an edit tab.
And if you don't even have a title on this 'paragraphs' you could edit your node.tpl.php to display an edit-link on this two nodes. <?php $front_nodes = array(34, 555); // Ids of the two nodes displayed on your front page print $content if ($is_front && in_array($node->nid, $front_nodes) && node_access('update', $node)) { print l(t('edit'), 'node/'. $node->nid, array('class' => 'edit')); } ?>
hth,
Stefan
sander-martijn wrote:
When I first set up my site, I added a story to the home page which now appears there but isn't editable from the home page. Can this be changed?
If you mean, can the home page actually be a different, editable page, then yes: go to Admin > Site configuration > Site information, and there's a "default front page" setting near the bottom. You can then change this to point to any other URL on your site, including e.g. a node of type "Page" which you can put editable content on.
Out of the box, Drupal sets the default front page to be the same as /node , which (again out of the box) produces a list of the last few nodes to be created and "promoted" to the front page. This is why you're seeing the story on the front page: if you added more stories, they'd probably appear there too.
Cheers, J-P
Quoting J-P Stacey jp.stacey@torchbox.com:
Out of the box, Drupal sets the default front page to be the same as /node , which (again out of the box) produces a list of the last few nodes to be created and "promoted" to the front page. This is why you're seeing the story on the front page: if you added more stories, they'd probably appear there too.
Not exactly. The stories are "Promoted" to the front page because that is what the work flow is set to do. If you change the work flow for the Story content type to not promote to the front page then you won't see it. However, a Page was designed out of the box to be static a page and not promoted while a Story was designed to be promoted to the front page.
Earnie -- http://for-my-kids.com/
On Aug 21, 2007, at 4:59 AM, J-P Stacey wrote:
Out of the box, Drupal sets the default front page to be the same as /node , which (again out of the box) produces a list of the last few nodes to be created and "promoted" to the front page.
This may be a dumb question, but how do you get additional pages which act like the front page, i.e. you can have a bunch of individually editable stories floating around which are serialized onto a single page?
-- roy@panix.com
Roy Smith wrote:
This may be a dumb question, but how do you get additional pages which act like the front page, i.e. you can have a bunch of individually editable stories floating around which are serialized onto a single page?
The views module would do that for you: Views and Views UI together for the editing interface at Admin > Site building > Views. There are several good tutorials for the views module on drupal.org so I won't repeat here.
Each view can support requests to a particular URL by enabling its Page mode: so you can register a view to handle a request to mysite.example.com/views_of_my_nodes/most_recent_sandwiches , or whatever. There's no real restriction on the syntax.
Cheers, J-P
And to add even more power, take a look at panels module. You can for example create a three column display that only shows up for one page that includes.
* multiple Views * Individual nodes, * Blocks * Custom PHP code.
These are independent of theme regions and only show up on the page you add them to. You can move the individual blocks/views/nodes around on the panel and reorder them using a slick gui interface. I use panels on almost all of my sites.
Dave
-----Original Message----- From: support-bounces@drupal.org [mailto:support-bounces@drupal.org] On Behalf Of J-P Stacey Sent: Tuesday, August 21, 2007 6:57 AM To: support@drupal.org Subject: Re: [support] Change home page from story to page?
Roy Smith wrote:
This may be a dumb question, but how do you get additional pages which
act like the front page, i.e. you can have a bunch of individually editable stories floating around which are serialized onto a single page?
The views module would do that for you: Views and Views UI together for the editing interface at Admin > Site building > Views. There are several good tutorials for the views module on drupal.org so I won't repeat here.
Each view can support requests to a particular URL by enabling its Page mode: so you can register a view to handle a request to mysite.example.com/views_of_my_nodes/most_recent_sandwiches , or whatever. There's no real restriction on the syntax.
Cheers, J-P -- J-P Stacey +44 (0)1608 811870 http://torchbox.com -- [ Drupal support list | http://lists.drupal.org/ ]