[consulting] preview of a home page

Bèr Kessels ber at webschuur.com
Mon Jan 8 09:16:04 UTC 2007


Because this topic grew out of hand, partly because of my answer 
(Being: "sorry, this is not possible because of Foo and Bar") I'd like to get 
this back on the original topic: Previewing the site as your users would. 

Let me explain a bit: 
Drupal has a unique interface: It is not the *place* (most of the CMSes call 
this an administrative backend) on the site that dictates what exactly you 
see, it is the place AND the permissions. 

Joomla!: Permissions dictate what *place* you can enter. That place allows a 
certain task. Only admins can access the admin area. FRom within that area 
they edit content, change settings etc. The frontend does not mind wether or 
not you are logged in or out. 
Drupal: Permissions dicate what elements a page shows. Organic groups, 
admin-node-permissions etc all change what nodes a list will show. Books will 
not show nodes 'in moderation' to anonymous users, but it will show to the 
content-adminitrators, etceteras. Depending on your rights,you will see tabs 
above the nodes or not. So if you want to preview a page without the tabs 
("the way a user sees the page") you have to log out, preview it, log in back 
again. I use two different browsers for this: in one I am logged in, in the 
other I am anon.

For this specific issue (wanting to preview a page the way a user will) Drupal 
is specificaly tough. after all, te page will show up, depending on *what you 
are allowed to see*. In contrary to Joomla or wordpress where there is a 
clear 'frontend' that will show up the same for everyone.

Attached is an attempt I did to make a preview module. I never finished it, 
because of technical problems that are no easy to overcome.The idea is 
simple: if the url contains ?sympal_preview=true that page will be built with 
admin rights. Problem is that Drupal does not let me change the user to 
anonymous early enough. By the time my module gets to change the user, it is 
too late; Another problem, that makes this hard, is security, the 
architecture should be such, that in no possible way, a random anonymous user 
can become an admin!

Feel free to use it, or to finish it. I might spend some time on this, 
provided I have a project that needs it. and a budget :). Oh, and feel free 
to "make a couple of bucks off my work...". 

Bèr


Op donderdag 4 januari 2007 16:41, schreef Mariano Barcia:
> Hi all,
>
> Isn´t there a way in Drupal to preview the home page, without actually
> publishing the nodes in the home page?
>
> I have been googling for this possibility, and also searching within
> drupal.org, but no luck yet. In large sites with many editors, there must
> be a way to preview how the home page will look like and I can't find a
> single mention to this issue. Other CMSs like OpenCMS have the concept of
> Online/Offline environments, or "sandbox" but that´s more developers
> terminology I guess.
>
> Or does the site admin actually preview the home page (sees the unpublished
> nodes)?
>
> Thanks very much in advance,
> --mariano


-- 
Drupal, Ruby on Rails and Joomla! development: webschuur.com | Drupal hosting: 
www.sympal.nl
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sympal_preview.module
Type: application/x-php
Size: 2333 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/consulting/attachments/20070108/d079aec6/attachment.bin 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.drupal.org/pipermail/consulting/attachments/20070108/d079aec6/attachment.pgp 


More information about the consulting mailing list