Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1

TOPIC:

A simple variable (easy question) 18 Mar 2013 03:37 #6971

  • geoffr
  • geoffr's Avatar Topic Author
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 68
  • Thank you received: 2
I am not a programmer and have the simplest of questions, almost embarrassing ;-)

I have created a component with Cook, and I now wish to add a variable into the header of the component that can be displayed on the front end flysheets.

Where/how do I set up the following variable?

$myPageTitle = '<span class="title">Welcome to My Component Page</span>';

I'm fine with the fly...
<?php echo $myPageTitle ?>

thanks,
Geoff

Please Log in or Create an account to join the conversation.

Last edit: by geoffr.

Re: A simple variable (easy question) 22 Mar 2013 14:54 #6992

  • JoomGuy
  • JoomGuy's Avatar
  • Offline
  • Moderator
  • Moderator
  • Joomla Enthusiast, Lover of Cooking
  • Posts: 1115
  • Thank you received: 195
I'm a bit unclear as to exactly what you're looking for...

Is this a title that you want rendered no matter who installs it and on which server?
Do you want it on every page of your component?

If yes to either or both of the above & you wish to let the admin of your component add this title themselves then:
add a config parameter to your component's xml, for example, a field called component_message. Then retrieve the value of the parameter as set by the admin of your component/site and echo it to the page. How to add parameters to your component: www.j-cook.pro/forum/9-coding-inside-you...d-a-work-with-params

On the other hand, if you want a 'fixed' message for every installation of your component that can't be overridden by the admin form the configuration, declare a helper function/variable in your helper.php file OR a JDom class and echo it on every layout.

Try looking at how the page title is already added to your views/layouts for more hints.

Hope it helps!

Gez
Need help with your Cook/Joomla Project? . PM me to find out what I can help with. NO time wasters please!!!
The following user(s) said Thank You: admin, geoffr

Please Log in or Create an account to join the conversation.

  • Page:
  • 1
Time to create page: 0.091 seconds

  Merci d'avoir présenté ce service web générateur de composant joomla. L'interface est très conviviale on a le plaisir du drag&drop et c'est assez rare pour être signalé. Je souhaite que ce projet connaisse un fort succès votre réalisation est méritante.
Yann Gomiero (AFUJ - France)

Get Started