Hi,
I have a client who (despite my protests on intrusive advertising) wants to create a popin on his site. I can do this quite easily if I had to do it manually, however instead of just doing it I would like to create a plugin which does this does and then put the extension in the JED (as I've already done before when I had ideas which I think can be re-used).
My question is, to create the plugin, I need to insert scripts in the head and in the body, and edit the body tag such I nsert onload scripts. Can this be done via a plugin? If yes, can someone provide a small example of how to do this?
I've got a background in web application development, but not much background in php / joomla development, so I'm familiar with the concepts but not with the APIs / methodology of doing this.
Plugin - editing body and inserting scripts
Moderators: tjay, seadap, Rogue4ngel, matthewhayashida
Plugin - editing body and inserting scripts
http://www.dart-creations.com - We make Joomla Easy: Tutorials, Tips and Tricks, Featured Articles Module, Random Flash Module, Latest News Popup Module, MainMenu Images Module, Popin Window Module
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!
Re: Plugin - editing body and inserting scripts
I'm not much of a php / joomla developer, yet.
Will these scripts be the same on all pages? If they will be the same, can you put this into the template?
Or are they database driven? I wouldn't know how to do this at the moment.
Will these scripts be the same on all pages? If they will be the same, can you put this into the template?
Or are they database driven? I wouldn't know how to do this at the moment.
http://springhillalumni.org • Springhill High School Alumni Association
Re: Plugin - editing body and inserting scripts
Yes I can put them in the template, but it is something I would like to avoid. If I can do it in a plugin, I had just call {popin} on a page particular content item, and they only get rendered in that particular page.
Any other suggestions please?
Any other suggestions please?
http://www.dart-creations.com - We make Joomla Easy: Tutorials, Tips and Tricks, Featured Articles Module, Random Flash Module, Latest News Popup Module, MainMenu Images Module, Popin Window Module
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!
Re: Plugin - editing body and inserting scripts
You can use JHTML::script() for files or $document->addScriptDeclaration() for including a variable that contains JS code in head. I think these two links will be useful for you:
http://api.joomla.org/Joomla-Framework/ ... tml#script
http://api.joomla.org/Joomla-Framework/ ... eclaration
http://api.joomla.org/Joomla-Framework/ ... tml#script
http://api.joomla.org/Joomla-Framework/ ... eclaration
My Joomla! 1.5 extensions - http://joomla.ercan.us
Progress is made by lazy men looking for easier ways to do things.
Progress is made by lazy men looking for easier ways to do things.
Re: Plugin - editing body and inserting scripts
That's great. Thanks.
Anything similar available for 1.0.x ?
Anything similar available for 1.0.x ?
http://www.dart-creations.com - We make Joomla Easy: Tutorials, Tips and Tricks, Featured Articles Module, Random Flash Module, Latest News Popup Module, MainMenu Images Module, Popin Window Module
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!
http://www.joomlawire.com - The Joomla DIGG network - Submit and Vote for Joomla News!