News and Gallery module variable conflict

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Cerulean
Forum Members
Forum Members
Posts: 172
Joined: Mon Nov 01, 2010 8:56 am

News and Gallery module variable conflict

Post by Cerulean »

The News module and the Gallery module both use variables named "nextpage".

If my News article contains a gallery (inserted via the WYSIWYG) then the {$nextpage} variable in my News template stops working so my News pagination breaks.

Is there a way to insert a gallery into a News article without this conflict occurring?
chandra

Re: News and Gallery module variable conflict

Post by chandra »

Maybe you can use an udt inside gallery template to get the value for $nextpage and assign it to an other named variable.

Think a simple

{$next = $nextpage}

will not work.
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am

Re: News and Gallery module variable conflict

Post by velden »

I think you should assign the value of the NEWS $nextpage to another var before calling the GALLERY:

Code: Select all

{$nextpagenews=$nextpage}
  {Gallery...}

   In your NEWS template you then use {$nextpagenews} of course
Cerulean
Forum Members
Forum Members
Posts: 172
Joined: Mon Nov 01, 2010 8:56 am

Re: News and Gallery module variable conflict

Post by Cerulean »

Thanks for the replies.

I think you're right velden, as it is Gallery that is overwriting the value that News is setting for $nextpage, rather than the other way around.

Also, I will raise a bug report for Gallery regarding the variable naming, as these modules are two of the most frequently used and it would be better if they could be used together without this sort of workaround.
Post Reply

Return to “Modules/Add-Ons”