1
rgauci
IXThemes scripts conflicting with Publisher module
  • 2010/5/23 19:18

  • rgauci

  • Not too shy to talk

  • Posts: 173

  • Since: 2007/8/31


I have installed ixt01713_2.6 on a new website and I am using Publisher as news module.

I am facing a small problem in that when I click on a photo image in Publisher, this module uses lightbox to popup a bigger image

Because ixt01713_2.6 theme has also its own scripts its somehow conflicting with Publisher.

Can anyone point me if I need to add more scripts in the metas.html of the ixt01713_2.6 themeplate? and what sort of scripts I need to add?
Be Set FREE!

2
culex
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 8:20

  • culex

  • Module Developer

  • Posts: 711

  • Since: 2004/9/23


Probably you'll need to rename the jquery or javascript functions.

<script type="text/javascript">
var j = jQuery.noConflict();
</script>

Then you can rename the for instance $("div p").hide(); to j("div p").hide();

Hope this will help
Programming is like sex:
One mistake and you have to support it for the rest of your life.

3
rgauci
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 9:46

  • rgauci

  • Not too shy to talk

  • Posts: 173

  • Since: 2007/8/31


thanks culex

can you please guide me to what files I need to hack like the Publisher modules or perhaps some files in the Theme itself

thanks
Be Set FREE!

4
mariane
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 11:20

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


you can do the following also:
in the js area in theme.html put this condition :
<{if $xoops_dirname != "publisher"}>
(here is the jquery link : like : <script type="text/javascript" src="<{$xoops_imageurl}>js/jquery.js"> </script>)
<{/if}>
the road of success is always under construction

5
kris_fr
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 11:33

  • kris_fr

  • Theme Designer

  • Posts: 1009

  • Since: 2005/12/31


grrrr

in the js area in theme.html put this condition :
<{if 
$xoops_dirname != "publisher"}>
(
here is the jquery link like : <script type="text/javascript" src="<{xoImgUrl js/jquery.js}>"> </script>)
<{/if}>

but why call several times jquery, just put this in the head part of its theme.html
<script type="text/javascript" src="<{xoAppUrl browse.php?Frameworks/jquery/jquery.js}>

6
Anonymous
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 12:03

  • Anonymous

  • Posts: 0

  • Since:


Thanks Kris

I think there are function in publisher check if jquery.js is exist or not before load own js file but I don't know where and how it work.

7
rgauci
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 12:04

  • rgauci

  • Not too shy to talk

  • Posts: 173

  • Since: 2007/8/31


hi kris_fr

in the ixttheme in the /tpl/scripts.html this exists:

<{if isset($xoops_version) && ($xoops_version|lower|replace:" ":""|truncate:8:"" == "xoops2.4")}>
<script type="text/javascript" src="<{$ixt_url}>/browse.php?Frameworks/jquery/jquery.js" charset="utf-8"></script>
<{else }>
<script type="text/javascript" src="<{xoImgUrl js/jquery.js}>" charset="utf-8"></script>
<{/if}>

and I replaced your line of script still did not work in publisher so I commented that and replaced with the code mariane suggested

in the js area in theme.html put this condition : <{if $xoops_dirname != "publisher"}> (here is the jquery link like : <script type="text/javascript" src="<{xoImgUrl js/jquery.js}>"> </script>) <{/if}>



and it worked. I do though agree totally with you when you said

Quote:

but why call several times jquery
Be Set FREE!

8
trabis
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 12:32

  • trabis

  • Core Developer

  • Posts: 2269

  • Since: 2006/9/1 1


Scripts ans css headers should not be hardcoded on the theme.

If you need to load jquery please use browser.php, however, harcoding it in the theme will output 2 link to jquery in the header. To avoid it, theme developers should include a php file and use:

global $xoTheme;
$xoTheme->addScript(XOOPS_URL '/browse.php?Frameworks/jquery/jquery.js');


$xoTheme will make sure that same urls will be included only once.

9
rgauci
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 13:07

  • rgauci

  • Not too shy to talk

  • Posts: 173

  • Since: 2007/8/31


@Trabis

<{if isset($xoops_version) && ($xoops_version|lower|replace:" ":""|truncate:8:"" == "xoops2.4")}> <script type="text/javascript" src="<{$ixt_url}>/browse.php?Frameworks/jquery/jquery.js" charset="utf-8"></script> <{else }> <script type="text/javascript" src="<{xoImgUrl js/jquery.js}>" charset="utf-8"></script> <{/if}>


the above code is already in the theme but conflicts with Publisher.
Then does it need to be changed to what you are suggesting?

by the way where is this browse.php file in the Frameworks?
Be Set FREE!

10
mariane
Re: IXThemes scripts conflicting with Publisher module
  • 2010/5/24 16:43

  • mariane

  • Theme Designer

  • Posts: 649

  • Since: 2008/1/11


Quote:
but why call several times jquery, just put this in the head part of its theme.html

Kris, I just giving him an example where to put the code and not suggesting him to put jquery.js
the road of success is always under construction

Login

Who's Online

222 user(s) are online (133 user(s) are browsing Support Forums)


Members: 0


Guests: 222


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: May 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits