Advertisement
article submit - show on frontpage default value
Moderator: General Support Moderators
Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
-
- Joomla! Apprentice
- Posts: 5
- Joined: Tue Jul 17, 2007 12:07 pm
article submit - show on frontpage default value
Hi,
where can I change the default value of the radiobutton 'show on frontpage' in the article submit page? I want to set it to true ...
thanks for helping
where can I change the default value of the radiobutton 'show on frontpage' in the article submit page? I want to set it to true ...
thanks for helping
Advertisement
- ooffick
- Joomla! Master
- Posts: 11653
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: article submit - show on frontpage default value
Hi, do you want to change that in the front end or in the back end.
If you want to change that in the front end, you can do that with the template overwrites:
Olaf
If you want to change that in the front end, you can do that with the template overwrites:
- create a folder in your template folder called "html" (if it doesn't exists)
- create a folder in that html folder called "com_content" (if it doesn't exists)
- create a folder in that com_user folder called "article" (if it doesn't exists)
- copy the file .../components/com_content/views/article/tmpl/form.php in this .../templates/[your-template]/html/com_content/article/ folder
- edit that file accordingly
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
- tw
- Joomla! Intern
- Posts: 70
- Joined: Wed Dec 13, 2006 10:32 am
Re: article submit - show on frontpage default value
Hi
In joomla 1.5 you find the value to change default "show on frontpage" in components/com_content/views/article/view.html.php
change this code:
To this:
0 is for default "No"
1 is for default "Yes"
That should do it!
In joomla 1.5 you find the value to change default "show on frontpage" in components/com_content/views/article/view.html.php
change this code:
Code: Select all
else { $article->frontpage = 0; }
Code: Select all
else { $article->frontpage = 1; }
1 is for default "Yes"
That should do it!
- urwie
- Joomla! Apprentice
- Posts: 8
- Joined: Fri Mar 20, 2009 6:43 pm
Re: article submit - show on frontpage default value
If you want to do the same thing for situations in which you create an new article from the backend, then you can do that by making some modification in controller.php (administrator/components/com_content/controller.php)
Line:532
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
Please make above code as follows:
if (!$edit) $row->frontpage = 1;
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
(So you add " if (!$edit) $row->frontpage = 1; " above the line)
Line:532
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
Please make above code as follows:
if (!$edit) $row->frontpage = 1;
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
(So you add " if (!$edit) $row->frontpage = 1; " above the line)
Test everything. Hold on to the good. (1Th 5:21)
-
- Joomla! Apprentice
- Posts: 15
- Joined: Sun Mar 02, 2008 7:40 pm
Re: article submit - show on frontpage default value
That works in the backend, but it doens't work for submitting articles in the frontend. Is there a way to do it so it works in the frontend?urwie wrote:If you want to do the same thing for situations in which you create an new article from the backend, then you can do that by making some modification in controller.php (administrator/components/com_content/controller.php)
Line:532
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
Please make above code as follows:
if (!$edit) $row->frontpage = 1;
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
(So you add " if (!$edit) $row->frontpage = 1; " above the line)
- ooffick
- Joomla! Master
- Posts: 11653
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: article submit - show on frontpage default value
Did you check the template overwrite option?
Olaf
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Apprentice
- Posts: 14
- Joined: Sun Apr 27, 2008 1:35 am
Re: article submit - show on frontpage default value
joePIPed, tw's post does what you're after.
I just wanted to thank both tw and ooffick. Each method works with no side effects that I can see in my 1.5.15 installation. I was worried that they might make ALL articles appear on the front page regardless of the radio button value, and (for anyone else wondering the same) they do not
I just wanted to thank both tw and ooffick. Each method works with no side effects that I can see in my 1.5.15 installation. I was worried that they might make ALL articles appear on the front page regardless of the radio button value, and (for anyone else wondering the same) they do not
-
- Joomla! Apprentice
- Posts: 8
- Joined: Tue Mar 29, 2011 6:28 pm
Re: article submit - show on frontpage default value
sorry for grabbing this old post...
but i have made both changes (tw's change and urwie's change) but it has no effect on my site (Joomla!1.5.17, i know i should do an update...)
backend -> add new article -> frontpage = NO (default)
frontend -> write new article -> frontpage = NO (default)
which editor did you use?
i use latest version of JCE...
did i made something wrong or is it not possible anymore to change the default value of frontpage option?
but i have made both changes (tw's change and urwie's change) but it has no effect on my site (Joomla!1.5.17, i know i should do an update...)
backend -> add new article -> frontpage = NO (default)
frontend -> write new article -> frontpage = NO (default)
which editor did you use?
i use latest version of JCE...
did i made something wrong or is it not possible anymore to change the default value of frontpage option?
http://www.gau-gaming.de | Multigaming Community
- ooffick
- Joomla! Master
- Posts: 11653
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: article submit - show on frontpage default value
So which files did you change?
Olaf
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Apprentice
- Posts: 8
- Joined: Tue Mar 29, 2011 6:28 pm
Re: article submit - show on frontpage default value
(administrator/components/com_content/controller.php)
Line:532
Please make above code as follows:
(So you add " if (!$edit) $row->frontpage = 1; " above the line)
AND:
components/com_content/views/article/view.html.php
change this code:
To this:
both did not tke the effect i would like to...
Line:532
Code: Select all
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
Code: Select all
if (!$edit) $row->frontpage = 1;
$lists['frontpage'] = JHTML::_('select.booleanlist', 'frontpage', '', $row->frontpage);
AND:
components/com_content/views/article/view.html.php
change this code:
Code: Select all
else { $article->frontpage = 0; }
Code: Select all
else { $article->frontpage = 1; }
http://www.gau-gaming.de | Multigaming Community
- ooffick
- Joomla! Master
- Posts: 11653
- Joined: Thu Jul 17, 2008 3:10 pm
- Location: Ireland
- Contact:
Re: article submit - show on frontpage default value
Hi,
ok, without your previous hacks, can you try the following template overwrite:
Olaf
ok, without your previous hacks, can you try the following template overwrite:
- create a folder in your template folder called "html" (if it doesn't exists)
- create a folder in that html folder called "com_content" (if it doesn't exists)
- create a folder in that com_content folder called "article" (if it doesn't exists)
- copy the file .../components/com_content/views/article/tmpl/form.php in this .../templates/[your-template]/html/com_content/article/ folder
- open that file
- find the following lines:
Code: Select all
<?php echo $this->lists['frontpage']; ?>
- and replace it with the following:
Code: Select all
<?php if($this->article->id) {echo $this->lists['frontpage'];} else { echo JHTML::_('select.booleanlist', 'frontpage', '', 1); } ?>
- save the file
Olaf
Olaf Offick - Global Moderator
learnskills.org
learnskills.org
-
- Joomla! Apprentice
- Posts: 8
- Joined: Tue Mar 29, 2011 6:28 pm
Re: article submit - show on frontpage default value
this works perfect for the frontend. that most i would like to use. backend is not so necessary for us... thank you very much!
http://www.gau-gaming.de | Multigaming Community
Advertisement