Hi guys,
Am a complete and utter newbie to this drupal thing, but, I have managed to create (or hack to be more precise) a new module for 4.5 that is roughly the same as front.module...and it actually works!
I think it might be of use to other users and looked at how to upload it to here, but, it looked too complicated.
The module allows you to setup a custom front page to your drupal installation in a very simple way from within Drupal (under administer - settings you can simply paste in your HTML, FLASH or other code).
The "default" out-of-the-box setting is that it will load your default theme and the default blocks, but, you can change that do it opens as a full page on it's own..i.e. without any blocks, different layout etc. instructions on how to change that are included in the module.
It works with Drupal 4.5 and all you have to do to install it is:
a) upload it to your modules folder in ASCII and naming it front_page.module
b) Go to Administer - Modules and enable the front_page module
c) Go To Administer - User - Permissions and enable ACCESS FRONT_PAGE.
d) Go To Administer - Settings - front_page and past in your HTML.
I hope this is of use to other drupal users.
// $Id: front_page.module,v 1.0 2004/11/24 Jasonm3m Exp $
/**
* @file
* This is my first module that allows the user to set a custom front page
* to the drupal installation.
*
* This module is designed for 4.5 compatibility
*/
/**
* Implementation of hook_help().
*
* This is the explanatory text that appears in your administer - modules page
* where you switch on/off modules
*/
function front_page_help($section) {
switch ($section) {
case 'admin/modules#description':
// This description is shown in the listing at admin/modules.
return t('this module allows you to set a custom home page.');
}
}
/**
* Implementation of hook_perm().
*
* this function makes the front_page option appear in the user - permissions page
*/
function front_page_perm() {
return array('access front_page');
}
/**
* Am not too sure what this function does.
*/
function front_page_link($type, $node = 0, $main) {
if ($type == "system") {
menu("front_page", t("front"), "front_page", 0, MENU_SHOW);
}
}
/**
* this function sets the necessary paths etc. so drupal
* knows where to find the front_page
*
* in your Administer - Settings make sure default front page is set
* to front_page
*
* Please note that I have left the Title blank below so nothing appears above the
* page when it is displayed.
*/
function front_page_menu($may_cache) {
if ($may_cache) {
$items = array();
$items[] = array(
'path' => 'front_page',
'title' => t(''),
'callback' => 'front_page',
'access' => user_access('access front_page'),
'type' => MENU_SUGGESTED_ITEM);
return $items;
}
}
/**
* this function allows a user to change or paste html in the
* administer - settings area.
*
*/
function front_page_settings() {
$output = form_textarea(t("Page text"), "front_page_text", variable_get("front_page_text", ""), 60, 10, t("Paste your HTML here"));
return $output;
}
/**
* print out the page
*
* this function loads up the front page and displays it
*
* the front_page module is setup to load the default theme and
* default blocks with it. If you want to change it so it loads
* as a full page on it's own..simple replace the last line where it
* says:
* print theme('page', $output);
* with
* print $output;
*
* That will load whatever you paste into your front_page settings under
* administer-settings as a full page.
*
*/
function front_page() {
$output = variable_get("front_page_text", "drupal");
print theme('page', $output);
}
P.S. Don't forget to include the opening and closing PHP tags.
Comments
Generally works, but ...
Here are a few comments:
1. When doing any admin functions, or even logging in, I get the following error:
and nothing displayed.
I use HTMLArea, and not sure if that is a factor or not.
2. This module could be useful for many, but I find that similar functionality can be acheived by just pointing the home page to a specific node, e.g. 'node/1234', and then putting whatever HTML you want in that node. This achieves a similar effect. If you are using taxonomy_context, then you get the menu on the side as a bonus. The only drawback here, is that:
a. You do not get the mission statement at the top.
b. You get the title, author and timestamp at the top of the node
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
thanks for the feedback
I use HTML area as well - it shouldn't make a difference.
The error you're getting is from line 94...which in the original module code I pasted earlier is a comment...i.e. it shouldn't do anything.
if you have edited the first_page.module code, just make sure the last few lines are as follows:
Or if you're using the front_page as a seperate full page in its own (without any blocks/headers etc.) make sure your last few lines are as follows:
In reply to your point 2...
That's precisely why I spent the time to hack together the front_page.module.
Drupal is superb, but, I wanted to have a "welcome" screen that would work for both logged in users & non-logged in users. The problem with making a node the default home page is that if users not logged in have ACCESS CONTENT disabled in the USER - CONFIGURE - PERMISSIONS page..drupal generates an error and for some reason that is beyond me, my server can't differentiate between a 404 error (file/page not found) and a 403 error (unable to access file/page).
The mission is intended for a "front page" thing, but, I found the mission automatically cached into the top of the default front page even when cache was disabled..i.e. the browser cache was remembering that the mission was there.
Hope the above works for you.
If the above doesn't work...
as a mini-troubleshooter..it maybe worth trying just typing in some words - i.e. not a full html bunch of code - into the front_page module settings...under ADMINISTER - SETTINGS - FRONT_PAGE. just in case there is something in the HTML you are pasting that is causing the hassle.
Cheers
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Still, there is an error message
I tried the change you suggested (instead of
print theme('page', $output);
I have:
print $output;
(Side note: perhaps this should be a configuration option, whether to put full layout with theme, or only your page).
Still got this error when trying to login using example.com/user:
warning: Cannot modify header information - headers already sent by (output started at /home/www/html/drupal/modules/front_page.module:95) in /home/www/html/live/includes/common.inc on line 218.
And the rest of the page is blank.
the funny thing is, there is no line 95 in the file. It is only 94 lines!
If I got to just example.com, the front_page module loads fine, with no error messages. I am not using any weird HTML or anything funny in it.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Make sure you didn't end up w
Make sure you didn't end up with an extra space in the file when you saved it. If you use Windows, use notepad, or Crimson Editor (www.crimsoneditor.com) to help prevent this.
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
That was it
I checked that the file has no line after the closing tag for PHP, but did not check if there was a space on the same line of the tag.
Indeed there was one space after the tag, and that was the cause of the problem.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
confused...
Am confused now...the code in my post now only has 91 lines in it! Someone else must be able to edit it. Judging by the changes, someone else is tidying up the code.
Anyways.
There must be some sort of PATHS issue or conflict...I tried to recreate the same problem you experienced by logging onto mysite/?=user page..but couldn't.
I don't understand why the front_page.module is being called/invoked from your USER page.
Can I suggest you try the following?
a) open your font_page.module in a text editor and make sure there are no extra spaces/lines at the end of the file..i.e. the very last line is:
?>b) if there are extra lines..removed them and upload the module again.
c) go to Administer - Settings and switch set cache to disabled. (AFAIK most browsers automatically cache anyway).
d) go back to your example.com page with front_page.module installed to see if it tosses up the same error....
If the above doesn't work..I'm afraid I'm stumped and I recommend you don't use it.Apologies if you have wasted a lot of time getting it installed and testing it.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
See my reply above
Fixed it.
See my reply above.
One more thing to add is an option of either to have a themed page, or a plain page.
Since this module will be useful for others, it is best to apply for a CVS account and ask permission to be the maintainer for the front page module, and put in your version for 4.5 and CVS.
http://drupal.org/node/6646
This way, there will be an official release with no need for copy and paste and all the problems that comes with them.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Summary module already does this.
The existing summary.module is designed as a front page and already includes the proposed functionality. If any more is desired, it should first be added to summary, so that we don't end up with multiple modules doing the same thing.
Summary module?
I thought that module just gives you more options for content you want on the front page, but necessarily a separate front page, like for those who want a splash front page in flash or dhtml. Could you explain the summary module a bit more?
No, but...
As it stands, Summary can't be used for a spash page. But my point is that, since Summary already exists as a front page module, it's good if energy can go first to adding the new desired functionality to that module. If that proves impossible, then by all means create a new module. But (from a cursory glance over the code) I'd say this could readily be incorporated into Summary. A bit more work, perhaps, than starting from scratch, but well worth the effort to avoid duplication. (I say this having myself drafted a "home" module some time back and then - when prompted by more experienced Drupal developers - finding I could put my enhancements into the existing Summary module instead.)
nice one..
Fair play to you Kbfahey...hope it ends up being of use to you..
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
front_page module for drupal 4.5...upgrade...
Hi guys,
Am probably getting carried away a little with my first ever drupal module...am amazed I was able to get this working...and I am aware there are other modules like Summary out there etc...but...I have "upgraded" it a little to allow for the folllowing functionality:
a) Allows you to specify a custom home page for both Logged in Users and Visitors to your site/users not logged in.
b) allows you to specify whether the pages are THEMED or FULL pages..
(i.e. a THEMED front_page will display your page WITH your default theme, layout and style sheet...a FULL front_page is a completely seperate page...where you can specify a completely different layout to your site.)
I created this so I could increase the ergonomics of the site and make it more friendly to visitors and registered users alike. So on the "not logged in" page, I can insert more information about what is inside, reasons for registering, help with getting a new password etc. that wouldn't be relevant to logged in users.
I hope the above makes sense and it is of use to drupal users. It works with drupal 4.5. Installation instructions are as follows:
a) Copy and paste the code below into a text editor like NOTEPAD.
(during the copy n paste process, make sure there are no extra spaces or lines at the bottom of the file...i.e. after the closing tag
?>. Otherwise the module will give you Header error messages)b) save it as front_page.module and upload it in ASCII format to your MODULES folder.
c) go to your ADMINISTER - MODULES page and enable the front_page module.
d) go to ADMINISTER - USER - CONFIGURE - PERMISSIONS and set the ACCESS FRONT_PAGE checkbox to what you want.
e) go to ADMINISTER - SETTINGS - FRONT_PAGE and paste in your HTML/Text for your front page and select whether you want it to be FULL or THEMED.
f) go to AMDINISTER - SETTINGS and set your default front page to be
front_pageThat's it!
Drupal automatically detects if the USER is logged in or not and directs people to the relevant page.
here's the module:
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
perhaps you should consider
perhaps you should consider applying for a cvs account and creating a project for this. That way it will show up on the modules page.
http://drupal.org/cvs-account
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
cheers sepeck
Thanks for the tip and link...I was looking for something like that earlier, but, couldn't find it.
Thanks again. Have applied for a CVS account.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
So is there a CVS for this?
For some reason I can't copy and paste and I don't want to copy out all the coe by hand if I can help it.
I have tried cutting and pasting from the normal view and also when trplying to the post. Neither worked for me.
have uploaded it to the CVS repositories..
Hi Eloieli..
I have uploaded it to the CVS repositories....
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/front/
Hope it is of use..
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
front_page.module written in
Hi Jason,
I liked your front_page module a lot so I am using it in a drupal site (www.elcolectivo.com); now I wanted to use it for a new site I am preparing, I wanted to see if there was a newer version of your module, but to my surprise what I downloaded was sort of a CVS log file. :-)
front_page.module is excelent. Thanks.
try this link instead
Hi Cubano..
Try this link instead..
http://drupal.org/files/projects/front-cvs.tar.gz
The link you tried is to the CVS repository where you can download the latest version...might be easier if you click on the link above if you're not used to how the CVS repository works..
The last update to front_page.module was a minor one and basically is an extra little facility that allows you the option to redirect logged in users to a specific page...
Hope thats of use...
Dublin Drupaller..
(Collegue of Jason)
A drupal user by luck and a dubliner by the grace of god.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
front_page
Hi Dublin Drupaller. Thanks for your quick answer. Great! I had forgotten the CVS download that I had done the first time in December :-)
Role based?
I'm not sure if this is already there, but would it be much harder to let admin choose the front page based on specific roles; that way groups could have their own front page with relevant info.? Thanks for putting this together. I'll go give it a whirl.
I was thinking about that...
Hi Jason...
yeah..I was just thinking about doing that..i.e. on a music site you could have a different starting page for
a) Drummers
b) guitarists
c) Singers
At the moment the front_page.module just looks to see whether the user is logged in or not logged in. I don't think it would be too difficult to extend that out to see what role type of user is logged in.....
having said that, isn't that very similar to what the new Sections.module for?
Anyway..will have a stab at updating the front_page.module at the weekend with the role thing as an option....
Would be handy if it works.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Front Page Module
It would be great if this was a "one shot" deal - and let me tell you what I mean.
When I installed your latest edition of front_page, I get this odd thing. When a user is not logged in, the anonymous user is presented with the front_page HTML text. This is awesome!
But, once they login, they are again, subjected to the blank logged in page (this is on purpose, since I didn't want to use a custom "logged in" page).
Is it possible to have this page as a (optional) node? (ie: once they log in, the front page system dumps them to whatever node I select?)
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com
I see what you mean....
Hi Shane,
I understand what you mean......and it's a great idea.....i.e. an administrator can setup a custom front for users not logged in..and has the option of redirecting logged-in users to another page.
Someone else asked if the front_page.module could be setup to be role based....i.e. an administrator could direct guitarists to a guitarists front_page...while sending drummers to the drummers front_page...
If you know what I mean.
That will do what you need your front_page to do as well...
I'm fairly new to drupal and php stuff..so it may take a while for me to implement what you asked but I will give it a go.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Excellent.
Thanks for your effort! (placing gold star sticker on your module)
I am going through a lot of modules to see how they work and, hopefully, will learn how they interact. Your module solves a lot of issues that I have watched get posted in the forums and either go unsolved (to what my specs need) or have gone ignored. So, I am supporting you 100%!
If I can lend a hand, I will send you whatever I can.
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com
Very exciting
Thank you, Jason, for taking this on. This module combined with taxonomy access provide huge enhancements to Drupal for (e.g.) the more corporate site where you want a configurable front page and various levels of access within the site.
I look forward to your updates, and seeing your module on the main downloads page. Very much worthwhile!
--
mediagirl.org
will do my best guys..
Please bear with me guys...am a newbie..
And as a quick note..I cannot take much credit for the front_page.module...it was very much based on the previous front.module.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
SHHH!
(whispering)
What are you doing, dude? Take the credit! It's yours! Go on! Seize it!
;-)
---
Shane Birley
Left Right Minds
https://www.leftrightminds.com
Permission checkbox missing
d) go to ADMINISTER - USER - CONFIGURE - PERMISSIONS and set the ACCESS FRONT_PAGE checkbox to what you want.
When I go there, I see nothing in the list for this node at all!
Kudos for your module thus far, however, would LOVE to move past part "d)" for finalizing the setup!
MAYBE there's something I'm doing but all worked 100% up to the permission setting part.
HELP!?
HI Tulula
Hey,
Sorry to hear you're having hassle...
You should see a permissions option...
A quick question: Are you using 4.5 or another version of drupal?
Are you able to access the front_page.module under the following menu?
ADMINISTER - SETTINGS - FRONT_PAGE
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Quick response!
All's great up until the setting permissions part! I recently did the 4.5.1 upgrade BUT that was only a bug fix. Perhaps that's where my troubles lie!
I don't see anything under ADMINISTER - SETTINGS - FRONT_PAGE either as assumed that I would be granted some view AFTER the Permission setting! THIS is so odd because I've not had any trouble with too too much, even after starting with Drupal 4.4 and moving onward and upward from there.
So basicly stuck at being able to enable within the module section but no changes surfacing under permissions or settings.
Hi Tulula
Try the following:
a) under ADMINISTER - MODULES click the check box to enable the front_page.module.
b) on the same page, scroll down and SAVE CONFIGURATION
c) go to ADMINISTER - SETTINGS - FRONT_PAGE.
you should see the front_page link on the left hand side underneath the SETTINGS link, and when you click on it you should see two text areas and some options for your front_page.
if you don't there is something wrong.
Have you renamed the front_page.module file by any chance?
If you don't see the link at stage (c)...suggest you try downloading front_page.module and installing it again.
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
BINGO!
Like magic now... I don't know where I read or got it in my mind to save my file "front.module" instead of "front_page.module" BUT coffee in hand now and working like a charm and a half!!!
Beautiful! EXCELLENT work! AND best support yet!
Thanks SO much JASONM3M!
:)
you're welcome
Glad it got working for you tulula.
And you're welcome. Am a complete newbie to this whole area of php, sql and stuff..so I was genuinely worried that I had made a simple mistake.
Relief!
Cheers
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Not really using it
I was just helping you test this module, and had some curiosity about it.
As I said above, I just set the home page to a node. When summary was mentioned, I was interested, since it lists taxonomy_context at the bottom.
However, both summary and front_page do not show the taxonomy_context on the side menus, which is a feature I want (it gives a sense of direction on my site which has a lot of terms in a multilevel hierarchy and articles within those terms). So, I will probably end up staying with my way of doing things (front page is just a specific node), and not using either front_page nor summary, as good as they are. The only drawback is the header (author, timestamp, category), which does not bother me much.
Anyway, it is a good start of a module. Your adding of new features to it is a good thing too.
When you get the CVS account, contact Dries or Moshe (you can subscribe to the drupal-devel mailing list and ask there) to make you the owner of the now abandoned Front Page module (front) http://drupal.org/node/6646
Rename your module from front_page to just front (and modify it internally accordingly), then commit it as the new version of that module for 4.5.0 and the CVS version.
This way there is no duplication of modules, and there is less confusion for the users.
I did the same for the feedback module, rather than create yet another new module for contacting the site admin.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Turn it off...
You know you can turn the header (author, timestamp, etc) off for nodes, right...
ray@bowers.com
http://www.RayBowersPhotography.com - personal site
http://www.HuntingtonClub.org - condo association running Drupal
didn't notice that Ray
Thanks for the heads up....does that make the front_page.module reduntant?
Jason
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
No, it does not
You still have the feature of an unthemed page which is not in Drupal base.
Also, your module provides a timestamp-less regular page, in case one wants to keep the timestamps for the nodes on the site (e.g. pages).
So, it is not redundant, and adds value for sure.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Thanks
Cheers K
Appreciate that..still fairly new to drupal so was nervous when submitting the module that it was just duplicating something I hadn't worked out was already there.
J
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Yes, I know that
Yes, I know that you can do that already.
However, it is a global setting. One you do it for a type of nodes, it takes effect for all nodes.
I want my articles to still retain the time stamp, so that is not an option.
As I said above, I am happy with making a regular node my front page. This way taxonomy context provides a navigable menu on the side, and there is a breadcrumbs trail on the top too.
Thanks anyway.
--
Drupal performance tuning and optimization, hosting, development, and consulting: 2bits.com, Inc. and Twitter at: @2bits
Personal blog: Ba
Redirect to default node
Instead of displaying the logged in user text, I really just want to redirect it to the defaul node level.
Is there any way to do that? I assume I need to change something in the else clause of this function:
function front_page() {
global $user;
if (!$user->uid){
$output = variable_get("front_page_text", "drupal");
$fpsize = variable_get("front_page_size", "drupal");
if ($fpsize == "themed") {print theme('page', $output);}
if ($fpsize == "full") {print $output;}
}
else{
$output = variable_get("front_page_text_yes", "drupal");
$fpsize = variable_get("front_page2_size", "drupal");
if ($fpsize == "themed") {print theme('page', $output);}
if ($fpsize == "full") {print $output;}
}
}
?>
redirect for not logged in users...
Hi Bcorrigan..
The current version of front_page.module allows you to do that. i.e. for not logged in users a special page is displayed...and you have the option of redirecting logged in users automaticlaly to a different page/section
Download from here:
http://drupal.org/files/projects/front-cvs.tar.gz
If you want a redirect for not-logged in users...we can do that as well...just let me know if that is what you want.
The new version of front_page.module - should be ready in mid-feb.
Drop me a message if you want the not-logged in redirect straight away and I can hack it for you.
Dub
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
User list
Hi. I am using your front_page module in http://www.elcolectivo.com and it works as expected. Thanks! I found a minor issue: If I activate the user list so it is shown in the user block, it will be displayed and accesible for anonymous users as well. Is this an issue of front_page or drupal access rights?
Best Regards
User Access rights
Hi Cubano,
The front page module doesn't have any influence on access rights...you need to hack your user.module to restrict access to the user list to authenticated users.
There's a discussion and solution at this thread that shows you how to insert an extra "ACCESS USERS" option on the User Permissions table:
http://drupal.org/node/13669#comment-22804
Hope thats of use...
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Thanks
Thanks for the indication; it is actually not what I need, which is that anonymous users do not see the user list. Your hack (I tried it anyway) restricts access to the user, but the anonymous user see the list outside in the block anyway, and see the user login names. This is what I want to avoid. I am using user.module from 4.5.2. Thanks anyway :-)
front_page ... doesn't
OK, I installed front_page.module with 4.52.
The module shows up in administer/modules, and I enabled it. It also shows up in administer/settings. I entered text for users not logged in, and different text for users logged in. I've tried selecting themed, full and redirect ... and nothing seems to work. In all cases, I get the default homepage.
What am I missing?
quick answer/guess
http://cvs.drupal.org/viewcvs/drupal/contributions/modules/front/README....
The readme.txt should have the following line
9. go to ADMINISTER - USERS - CONFIGURE - PERMISSIONS to toggle the ACCESS FRONT_PAGE setting*
(* IMPORTANT: this sets access to front_page for anonymous user and authenticated user so the users can view them.)
Hope that helps
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Fixed
Fixed. In addition to the permissions issue, I had not changed the default homepage for the site from "node" to "front_page."
Thanks.
front_page (FRonT) and css
My desired Front has html and a seperated css page. Can I employ that way of doing things. I wouldn't know where to put the css file, after a breif look at the module's code. I've only been with drupal for a few days.
-----------------------------------------------------
"It's never too late to have a happy childhood."
where to put the css..
hi,
There's a number of ways you can do this..one approach might be to:
(a) make sure your front page is selected as a FULL PAGE..so it doesn't load the default theme and styles.
(b) In your splash page HTML, paste a link in the HEAD of the document that points to the external CSS - which means you could upload it anywhere. Just as long as your front page HTML document is able to pick it up from the link.
Drupal tends to store CSS files under the /themes/ folder. don't put your front_page.css in there (it will confuse your theme admin page)....better to create a new folder, upload it to there and lunk it across.
(c) of course, you could simply paste in the css into your HTML document (between the opening and closing HEAD tags)...I suppose if you need to edit it you can use the front_page.module to edit the css as well as editing the content...
Hope that makes sense and is of use..
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
relative url to css
I did try to drop the css in the root and the modules directory, but no luck. How do I configure a relative link to the css file? (relative to where)
-----------------------------------------------------
"It's never too late to have a happy childhood."
at the top of your html..
Hi,
At the very top of your HTML ...where you point to the CSS file..
i.e.
in your html file you have the following:
(replace square brackets with the angled brackets)
Hope that helps
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Thanks Dublin. It's
Thanks Dublin.
It's still not precisely clear to me.
I suppose you mean the HTML file I am pasting into the front page form, in which I use this style of tag:
link rel="stylesheet" type="text/css" href="path/to/css/front_page.css"
I don't understand the form of link you ae using '@import url' is this necessary for php or what? (I don't know much php yet).
Anyway, I can write in the path, but I don't know how the module works yet, and in this case therefore, I don't know which is the root directory from where the url is called. So, what I've been asking is, what directory is this 'path/to/css/front_page css' relative to?
Hope the question is clear!
-----------------------------------------------------
"It's never too late to have a happy childhood."
quick one..
Hiya...
No idea in detail what the @import thing is...sorry..do a google for more information on it. All I know is that when it's in the HEAD of a html file it loads an external style sheet (CSS) into the HTML document.
(as a tip: open up your drupal site and in your browser go to VIEW - VIEW SOURCE..you will see how drupal uses it to load in the basic drupal.css file)
re: The path.
the path is relative the base URL you entered in your Conf.php file when installing drupal...
I would suggest you put a /front_style/ folder in your /drupal/ folder.
In that case the link to your custom style is:
link rel="stylesheet" type"text/css" href="front_style/front_page.css"
As a tip/suggestion..I strongly recommend you do an online tuitorial on how CSS works..and once you've mastered that..work out how to mix some simple PHP in HTML.
I found the following tips extremely helpful when starting with drupal..
http://www.htmlite.com/CSSintro.php
There is a link there to some simple PHP in HTML commands..which I find myself referring back to a lot.
For a designer to really unleash the power of drupal and come up with good designs..a good solid understanding of CSS is vital. Essential even.
Hope that helps..
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Clear
Thanks again Dublin. That's clear as I'd like te sky to be. And informative. I'll proceed with confidence.
-----------------------------------------------------
"It's never too late to have a happy childhood."
Nice job! and a slight clarification on the setup ...
Very nice job! Thanks for this module ... I was going slightly nutz trying to figure out how to do an override of the "Promoted to front page" option in the "create content" stuff.
With this module, the checkbox is effectively a no-operation.
A quick clarification on the procedure for enabling the front_page module: I spent most of an hour figuring out how to set the "default page" via the "settings" menu; I clicked on "administer->settings" but didn't look closely at the page after the click. I proceeded to go to the "front_page" section of the settings block, but could not find the "default page" option.
So for those who couldn't find it either:
administer->settings ... and look at the page with the various options
before proceeding/selecting the "front_page" settings.
good idea...
I understand how people might get confused..
Quick question: did you get a readme.txt file with your front_page.module download?
It clearly outlines step-by-step how to install..
Re: the "promote to front page" confusion...it might be easier to change the name of the module from FRONT PAGE to SPLASH PAGE...
Will check with the drupal developers if this is a better idea...
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
agree, with one minor issue...
This module is great for what I want, which is a completely custom "splash page" for some of my websites, however the one issue I have is that some of my sites are not user/community based (only logged in users are admins). While the module does what I want, the problem I'm having is that any "home" links goto the site root and in turn the "splash" instead of the "front" node (in breadcrumbs/primary/secondary menus etc)
Is there an easy way to make the FrontPageModule page only show up when you first visit the site? (perhaps another option?)
cookies
Yes, there needs to be a cookie identifier to keep the splash from repeatedly showing to someone who has seen it.
Page Text As a Node
Is there some reason you didn't make the Text for the front_page a Node of Page type instead of using a variable.
There are alot of advantages this could have, such as view_counter, stats will be tracked better,Taxonomy Menu could be used, etc. I think this would be a pretty simple change and it would also allow the security to be tied in easier when using a page that is not tied to the site theme.
When I have time I may try to make this mod and submit it unless you have already thought about it.
Steele Price
http://steeleprice.net
never thought of that Steele..
yeah..I did consider that at the outset, but, we thought that if a user is using a theme node page as the front page...there is little point in using the front_page.module in the first place...i.e. a simple "if the user is logged in display this" or "if the user is not logged in display that" php thing could be put in the node page. And I wasn't sure if the PROMOTE TO FRONT PAGE option on nodes would already do that for you.
As drupal gets better and even better, there is less need to use the front-page.module..I still use it with a drupal 4.6. install, purely because it's really handy and simple for maintaing a splash page to the site with flash and a different layout to the rest of the site.
I get a lot of emails from newbies who find it very useful and especially when it's a members-only type site. So please feel free to do the patch you mentioned..and drop me an email when you have it up..
We're always looking at ways to improve it and it's due an update.
the next pending updates to the front_page.module are:
(a) insert a checkbox to say MAKE SAME AS ABOVE..(if people are using the same code for logged in users and anonymous users they don't have to paste the code into two fields)
(b) look into redirecting based on role (i.e. take the guitarists to the guitar section...or take the drummers to the drummers section..if you know what I mean).
Hope that makes sense..
Dub
DUBLIN DRUPALLER
___________________________________________________
A drupal user by chance and a dubliner by sheer luck.
Using Drupal to help build Artist & Band web communities.
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
adding an image to front_page php snippet
I am using the nice little snippet below to pull nodes fom various categories into my front_page. I would like an image to be associated with the front_page content areas, so that no matter what "Project" is displayed, for example, the same image accompanies it. How can I modify this snippet to display an image? Is there a way to integrate an img src tag? Or an image node (I have image, inline, upload, gallery modules installed)? Or am I barking up entirely the wrong tree?
thanks
jen
quick one...
Hi Jen,
Understanbd completely what you mean....what you can do is create a 2 column table and put the image in the left column with the dynamic list of nodes in the right column..
If you change the last line
print $outputto this:I haven't tested that code...but it should be self explanatory and get you started...
hope that makes sense...and helps
Might be worth checking out this page which explains how to do more sophisticated layouts using php snippets and links to useful examples you can pick up and tweak.
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
"sophisticated layout"...isnt that a song?
http://girls.digitalgirls.org/drupal-4.6.2/
Yeah, that would be a great solution, but it would require some super-kluges for the design:)
I wound up doing it with css.
Thanks for the tips.
cheers
jen
how did you do it with css?
Hi Jen..
can you post how you did it with CSS?
that's how most of us learn new techniques on here...i.e. people find a solution and then post how they did it....it's sort of the whole point of the forum that falls apart when people leave "thanks..got it sorted..see ya!" messages without explaining how they did it..
Cheers
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
adding image
Sure, here's my solution. Pretty basic.
my "icon" class is set to float left.
Hope this helps someone :)
For basic splash page override, this module works great!
So far I've just used it to add temporary basic splash pages while my sites are being developed, and it works very well. Just thought I'd post and say THANKS!
Hallo,
Hallo,
This is real fine module to get out the best of your drupal site.
I wanted:
- a dynamic front page (i.e. php)
- the basic theming should be there (title, slogan, primary and secondary links) but
- no blocks to show on the page
- using PHPTemplage
You normally cound do that telling every block that it should not display on the front page - but this is laborious (especially when adding new blocks, not to forget to set them up corretly). Don't know if it is according to standards here, but finally it fulfilled my requirements (and my be discussion or help for others):
page.tpl.php
Stripping HTML tags?
I am having a problem in that HTML code I enter into the textarea in the front_page module is being stripped and reformatted as soon as I save the changes. I have selected FULL page, which I thought would leave any code untouched.
I have turned off all the HTML filters in Input Formats.
I am using front_page 1.22 on Drupal 4.6.4
Any ideas?
will have a quick look
I'll have a quick look and get back to you..
By the way..it's better to post an issue/bug..
http://drupal.org/node/add/project_issue/front
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
Oh...right.
Yes, good point. Wasn't thinking...
redirection limit exceeded
Hi,
great module, really helps to be able to have a non-themed front page. Everythings working great, but I'm getting one error, only occassionally.
I get this popup message when I request the home page sometimes, notably when i logout, and other times just when clicking on the site title or logo.
"Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."
I am using mozilla on windows, and do not have cookies blocked.
Any ideas?
thanks,
Rachel
quick one..
Hi Fudge...
Likely reasons for the error are:
(a) there is a bug in your .htaccess file that is redirecting you to a nonexistant url.
(b) You have a REDIRECT loop problem. for example, in your front_page for anon users, you might be redirecting anonymous users to a page that redirects anonymous users back to another node that redirects them back again. So they are essentially stuck in a loop or are being redirected about too much before they land on a page.
if you haven't changed your .htaccess from the default Drupal .htaccess, can you post any PHP snippets or check any redirects you may have setup ?
Which version of Drupal are you using by the way?
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate