HTML Logo by World Wide Web Consortium (www.w3.org). Click to learn more about our commitment to accessibility and standards.

Moving forward with Composr

ocPortal has been relaunched as Composr CMS, which is now in beta. ocPortal 9 will be superseded by Composr 10.

Head over to compo.sr for our new site, and to our migration roadmap. Existing ocPortal member accounts have been mirrored.


Trouble with banner links opening new page

Login / Search

 [ Join | More ]
 Add topic 
Posted
Rating:
#59398 (In Topic #12932)
Avatar

Community saint

Trouble with banner links opening new page

I am having trouble here with some internal banner links. This banner is for an onsite location in the Galleries module. I would like this banner to link to a particular members gallery and this is the code I am using:

Code

/~prehisto/site/index.php?page=galleries&type=misc&id=andrey_atuchin
Fine, it works

…but it is opens a new page. I used the code from my SIDE_ROOT_GALLERIES links and they don't open a new window. I want it to operate the same way the SIDE_ROOT_GALLERIES do.

What am I missing?


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Art Gallery
powered by ocPortal
Back to the top
 
Posted
Rating:
#59404
Avatar

Hi,

The BANNER_IMAGE template contains:

Code

rel="external" title="{!LINK_NEW_WINDOW}" class="link_exempt" target="_blank"

You could strip it, although that would affect all image banners.

I think changing it to this may do what you want:

Code

<a {+START,IF,{$NOT,{$IN_STR,{URL},{$BASE_URL}}}}rel="external" title="{!LINK_NEW_WINDOW}" class="link_exempt" target="_blank" {+END}href="{$FIND_SCRIPT*,banner}?source={SOURCE*&}&amp;dest={DEST*&}&amp;type=click{$KEEP*,0,1}"><img width="{WIDTH*}" alt="{CAPTION*}" style="border: 0" title="{CAPTION*}" src="{IMG*}" /></a>


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59425
Avatar

Community saint

I tried out the code and when the top banner (off-site link) is clicked the whole page goes to the adverisers page. I think that before I put in the new code, that action would open up a new page.

Then the on-site links still open up a new page - these were the ones I wanted to work like the SIDE_ROOT_GALLERIES links operate.


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Art Gallery
powered by ocPortal
Back to the top
 
Posted
Rating:
#59449
Avatar

That sounds like it's doing the opposite of what you wanted, but I just tested this and it seems to work. Attached is the changed template.

It is important that the URL to the local banner does start with the base URL to your site (i.e. it should not be a relative URL, and it should not be a URL that has an alternative domain name).

Attachment
» Download: BANNER_IMAGE.tpl (322 Bytes, 119 downloads so far)


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59572
Avatar

Community saint

Chris, the download for BANNER_IMAGE.tpl is the same code as you mentioned in your first reply. I had already tried that one out without success.

friendly said

…when the top banner (off-site link) is clicked the whole page goes to the adverisers page. I think that before I put in the new code, that action would open up a new page.

Then the on-site links still open up a new page - these were the ones I wanted to work like the SIDE_ROOT_GALLERIES links operate.


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Art Gallery
powered by ocPortal
Back to the top
 
Posted
Rating:
#59581
Avatar

Could you edit your banner URL to be like:

Code

 http://prehistoricsillustrated.com/site/index.php?page=galleries&type=misc&id=andrey_atuchin
rather than:

Code

 /~prehisto/site/index.php?page=galleries&type=misc&id=andrey_atuchin

That should do it. I wrote the code change above to compare the start of the URLs.

As for external links, I've had a look on your site and I see these are from another ad network (Google maybe), which aren't controlled by our templates unfortunately, so I can't think of any easy workaround to make them open in new windows. Maybe Google have a setting.


Become a fan of ocPortal on Facebook or add me as a friend. Add me on on Twitter.
Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about ocPortal whenever you see the opportunity.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying ocPortal on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Back to the top
 
Posted
Rating:
#59592
Avatar

Community saint

That did it for the on site banner links changes the page and doesn't open a new window so that part is good. Thanks again

As for the top banner adds they are Amazon and I still will look for a solution to why they change the page. The bigger Amazon add down on the main page will open a new window which is good so I'll have to look at that further and figure out why the difference?


Art and Imagination
of David L Friend

http://davidlfriend.com

  My Art Gallery
powered by ocPortal
Back to the top
 
There are too many online users to list.
Control functions:

Quick reply   Contract

Your name:
Your message: