Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Remove Style/Script from a component/module
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  4 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Viktor Iwan  
View profile  
 More options Aug 19 2012, 1:28 am
From: Viktor Iwan <vic...@doxadigital.com>
Date: Sat, 18 Aug 2012 22:28:48 -0700 (PDT)
Local: Sun, Aug 19 2012 1:28 am
Subject: Remove Style/Script from a component/module

Hello all, i try to remove some script/style in head document from a
module/component..
i'm using this code:

$doc = JFactory::getDocument();
$headData=$doc->getHeadData();
unset($headData['styleSheets'][JURI::base(true).'/libraries/cck/rendering/a ssets/css/content.css']);

when i trace, the array unset successfully, but the style still echo in the
document ...

any idea how to make it work ?


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Chris Davenport  
View profile  
 More options Aug 19 2012, 3:31 am
From: Chris Davenport <chris.davenp...@joomla.org>
Date: Sun, 19 Aug 2012 08:31:10 +0100
Local: Sun, Aug 19 2012 3:31 am
Subject: Re: [jgen] Remove Style/Script from a component/module

Did you do a $doc->setHeadData( $headData ); afterwards?

Chris.

On 19 August 2012 06:28, Viktor Iwan <vic...@doxadigital.com> wrote:

--
Chris Davenport
Joomla Production Leadership Team

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Viktor Iwan  
View profile  
 More options Aug 19 2012, 11:20 pm
From: Viktor Iwan <vic...@doxadigital.com>
Date: Sun, 19 Aug 2012 20:20:47 -0700 (PDT)
Local: Sun, Aug 19 2012 11:20 pm
Subject: Re: [jgen] Remove Style/Script from a component/module

Hi Chris, it did works ! but only when i remove a single array, if i did
this:
$doc = JFactory::getDocument();
$headData=$doc->getHeadData();
unset($headData['styleSheets'][JURI::base(true).'/libraries/cck/rendering/a ssets/css/content.css']);
unset($headData['styleSheets'][JURI::base(true).'/libraries/cck/rendering/a ssets/css/cck.css']);
unset($headData['scripts'][JURI::base(true).'/media/cck/scripts/jquery/js/j query-more.js']);
$doc->setHeadData( $headData );

it won't work... any idea ?

Pada Minggu, 19 Agustus 2012 14:31:10 UTC+7, Chris Davenport menulis:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Viktor Iwan  
View profile  
 More options Aug 20 2012, 1:18 am
From: Viktor Iwan <vic...@doxadigital.com>
Date: Sun, 19 Aug 2012 22:18:38 -0700 (PDT)
Local: Mon, Aug 20 2012 1:18 am
Subject: Re: [jgen] Remove Style/Script from a component/module

It fixed when i create plugin and put it on event onBeforeRender().

Pada Senin, 20 Agustus 2012 10:20:47 UTC+7, Viktor Iwan menulis:

Pada Senin, 20 Agustus 2012 10:20:47 UTC+7, Viktor Iwan menulis:

Pada Senin, 20 Agustus 2012 10:20:47 UTC+7, Viktor Iwan menulis:

Pada Senin, 20 Agustus 2012 10:20:47 UTC+7, Viktor Iwan menulis:


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions Older topic »