K2 Thumbnails to External URL???

GK User
Thu Jun 14, 2012 5:23 pm
On my website- which utilizes News Show Pro just like the demo, takes you to a K2 article (like it is supposed to) but we are so busy we just dont have time to update/maintain the articles.

We use the articles to display featured projects but we would like to directly link the thumbnail to an external URL, more specifically the project itself.

My site is:

http://www.vector-theory.com/

For example, I would like to link the "Zen Bistro" Thumbnail directly to the Zen Bistro website, not the K2 article.

You'll notice 3 of the 5 projects on there are Gavick templates, We are launching another tomorrow using "Game Magazine" for an NFL DJ :)
User avatar
Expert Boarder

teitbite
Thu Jun 21, 2012 8:41 pm
Hi

Sorry, but NSP was not designed to link to an external page. I do not know a module which can do that, because how to specifie which article to link where if it's content is dynamic. So I suggest to use mod_custom and make it look like NSP.
User avatar
Moderator

GK User
Fri Jun 22, 2012 4:39 am
You can use following javascript in footer.php or any other means. Look in joomla extensions for a module to include javascript.

What this does is adds .nspbox"x" to each gallery item in html. So if you have 5 items each will have additional .nspbox1 nspbox2 and so on.
Add following code to end of footer.php
Code: Select all
<script>
jQuery(document).ready(function(){
var arts = jQuery('.nspArt');
   arts.each(function(i){
      var num = i + 1;
     jQuery(this)
        .addClass('nspbox' + num )
   });
   var link1 = jQuery('.nspbox1 > div > a');
   link1.attr('href','http://www.gavick.com').attr('target','_blank');
   var link4 = jQuery('.nspbox4 > div > a');
   link4.attr('href','http://www.gavick.com').attr('target','_blank');
});
</script>


Only parts you need to change is following. link"x" , .nspbox"x", link"x".attr. Replace x with nth number. Obviously also change website url. If you have 10 items simply dublicate below and change its number.
Code: Select all
   var link1 = jQuery('.nspbox1 > div > a');
   link1.attr('href','http://www.gavick.com').attr('target','_blank');

So for an example if you want to edit 4th box then you need to change as below. Simply change 1 to 4 in all instances.
Code: Select all
   var link4 = jQuery('.nspbox4 > div > a');
   link4.attr('href','http://www.gavick.com').attr('target','_blank');


Links will open in new tab or new window.

PS: You can also override css effect by using .nspbox"X" css class.

See you around...
User avatar
Platinum Boarder

teitbite
Sat Jun 23, 2012 11:44 am
Hi

Yes this is kind of a solution, but what to do if there is couple of articles added daily ? Than I would go with a plugin extending article attributes and use Your code in a dynamic way with an url taken from additional article attribute. Unfortunately without this it's a static solution and as I understood the case of that was to cut the time.
User avatar
Moderator

GK User
Sat Jun 23, 2012 11:00 pm
No offence teitbite, this was just a quick workaround. Considering number of projects that was added and wasn't factoring the fact user will be adding 2/3 projects everyday this was easier to do. ;)
User avatar
Platinum Boarder

GK User
Mon Jun 25, 2012 5:50 pm
thank you both.

I wanted to keep the NSP because I like the roll over and slide effect. I only expect to be adding about two projects a month, so normans solution will likely work well. I will report back once I make these changes.

Thanks again
User avatar
Expert Boarder

teitbite
Mon Jun 25, 2012 10:37 pm
Hi

I got one more idea. It can be done also by placing a link in tags which will be parsed from article content and replaced if found. Unfortunately this will require some changes to module code too.
User avatar
Moderator

GK User
Thu Jun 28, 2012 12:23 am
I went with Normans method using "Custom HTML Advanced" Took me about 10 minutes... this is what I was trying to do!! thanks again.

although the text doesnt link, just the pic- http://www.vector-theory.com/

I am fine with this though.
User avatar
Expert Boarder

GK User
Thu Jun 28, 2012 1:00 am
You can use following set which changes the text link as well.

Code: Select all
       var link1 = jQuery('.nspbox1 > div > a');
       link1.attr('href','http://www.gavick.com').attr('target','_blank');
      var title1 = jQuery('.nspbox1 > div > h4 > a');
      title1.attr('href','http://www.gavick.com').attr('target','_blank');


See you around...
User avatar
Platinum Boarder

teitbite
Thu Jun 28, 2012 2:01 pm
Hi

Ok. No problem. Anyway it may be a good idea co develop a plugin for NSP which would allow to add external URL inside article already. I'll do that when I have time.
User avatar
Moderator

GK User
Fri Jun 29, 2012 4:08 am
Yea it will be good. Few points to consider.

- Change Image to a specified image.
- Change Image Link
- Change Text
- Change Text Link
- Change or Add css class for easy overriding original css.

Module or Plug-in.

Module easy to allocate on specified pages if user has more then one module to customize. Publish on template specific position or recreate a position, possible future questions in forum regarding this.

Plug-in , how would we assign it to a specific pages if user has more then one module and different customizations in each or we make it usable in front-page only.

See you around...





-
User avatar
Platinum Boarder

teitbite
Fri Jun 29, 2012 4:47 pm
normanUK wrote:Yea it will be good. Few points to consider.

- Change Image to a specified image.
- Change Image Link
- Change Text
- Change Text Link
- Change or Add css class for easy overriding original css.

Module or Plug-in.

Module easy to allocate on specified pages if user has more then one module to customize. Publish on template specific position or recreate a position, possible future questions in forum regarding this.

Plug-in , how would we assign it to a specific pages if user has more then one module and different customizations in each or we make it usable in front-page only.

See you around...





-



Hi

A css can be modificated using module class suffix, so this part is covered.

I was thinking more about NSP plugin to appear in articles editor to put this additional informations as text for link and link there, so NSP reading an article may overwrite the regular title and article link. With such solution we can avoid a problem of how to point links to be overwritten.
User avatar
Moderator

GK User
Sat Jun 30, 2012 4:22 am
I see what you mean, basically a content plug-in. Very good idea and yes you are right will make the job easier.
User avatar
Platinum Boarder

teitbite
Sat Jun 30, 2012 1:39 pm
Hi

I just believe it's more flexible this way. Unfortunately I do not have time right now to make it :( Anyway I'll write it into my schedule.
User avatar
Moderator


cron