0

I am looking to modify the article component ( I do not want it to have the same article options as my main menu, but rather use the global article settings and not have to change it for each individual article, see: Joomla 3 Article Options - How to get article view different from category blog view)

To do this I need to get the parameter values set in the global article manager options (System->Global Configuration->Articles). For example the "Show Author" parameter. I have tried googling this to no avail. I have looked at the docs for JApplication, JRegistry and more and cannot see anything that would point me in the right direction.

I could probably do a SQL query to get the values, but it feels as if Joomla should have this functionality already built in.

Thanks Roelf

Community
  • 1
  • 1
Talib
  • 335
  • 3
  • 15

2 Answers2

1

You should be able to do this like you would for any component's parameters:

$app = JFactory::getApplication('site');
$componentParams = $app->getParams('com_content');
$param = $componentParams->get('paramName', defaultValue);

More here: How to get component parameters?


Beyond setting parameters on the article itself, you can also override the parameters on a menu item basis. A common practice is to set the global parameters to be what you generally want for pages. Then create a menu item for say your blog category and override the article settings for the blog menu item to create the different feel of the blog.

As long as you are using menu items and core content layouts, you really shouldn't need the code above.

Community
  • 1
  • 1
David Fritsch
  • 3,711
  • 2
  • 16
  • 25
  • The problem is I only have one menu (main menu) in category blog mode displaying the articles. If I click on the read more button to view the full article, the article view has the same settings as the menu and not the global ones. (Please see the link I posted where I describe my problem). Also will the above code give me the inherited parameters or the global ones? – Talib Apr 23 '14 at 09:05
0

There are three different places where you can select the individual parameters. In Menu Magager you can choose whether to be Global, choices in each article or the setting in the specific menu that determines each parameter Global configuration, see Content / Article Manager - select Options.

KlintWeb
  • 31
  • 1
  • 10