Content plugin adds CSS/JS several times into the head

More
12 years 4 months ago #27174 by pabro
Hi,

i have installed a plugin (content/onpreparecontent) to add some metatags to head ($doc->addCustomTag()). The plugin works but is insert the tags at several times (3 × instead 1).

I also have a siplus plugin (replace {siplus} tag with thumbnail) installed and enabled triggering for 2 fields (only sigplus).

Is there a solution to avoid the double entries without to deactivate sigplus, for example with modify the plugin code?

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

More
12 years 4 months ago #27177 by ggppdk
Well no, there is no way, the plugin itself should detect and avoid adding the CSS multiple times, or you should do a global search on the output to remove multiple entries.

Report this to the author of the plugin.

You can add this to the plugin code
Code:
static js_css_added = false; if (!$js_css_added) { static js_css_added = true; // ... add the js and css stuff to head }


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

More
12 years 4 months ago #27184 by pabro
Thank You! The developer is me ;) its my first plugin ... your approach was very helpful :)

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

More
12 years 4 months ago #27197 by ggppdk
Above i had a syntax error, i corrected it, i guess you did too. ;)


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star...

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

Moderators: vistamediajoomlacornerggppdk
Time to create page: 0.390 seconds
Save
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline