Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#13 2011-01-04 13:44:18

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,135
Website

Re: adi_link – Enhanced links

Another great adi_plugin!

Just a note that on line 139

		$ext_link ? $class = "ext_link" : $class = "";

should read:

		$ext_link ? $class = $ext_class : $class = "";

so that you can set your own external link class.


TXP Builders – finely-crafted code, design and txp

Offline

#14 2011-01-05 09:26:28

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,304
Website

Re: adi_link – Enhanced links

Thanks jakob, much obliged. I’ll look into it.

Offline

#15 2011-02-23 00:28:40

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,304
Website

Re: adi_link – Enhanced links

Version 0.4 now available for download

  • new attribute: ‘short_url_text’
  • new attribute: ‘url_text_only’
  • fixed coding faux pas when setting ext_class (thanks jakob)

Offline

#16 2011-04-04 12:11:18

ricetxp
Member
From: London, UK
Registered: 2005-05-24
Posts: 89
Website

Re: adi_link – Enhanced links

Hi Adi
Is there a way to achieve this:

<a href="link_url">Label text | link name</a>

<txp:adi_link id="5">Hello world</txp:adi_link> doesn’t create a link and <txp:adi_link id="5" label="Label text" wraptag="p" /> produces this:

<p>Label text<a href="link_url">link name</a></p>

Thanks

Offline

#17 2011-04-04 21:30:47

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,304
Website

Re: adi_link – Enhanced links

Hi Edward,

Are you wanting to prefix the link text (i.e. within the <a>...</a>)?

Adi

Offline

#18 2011-07-11 04:11:17

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: adi_link – Enhanced links

Total newb here so forgive me for sounding so stupid.

I downloaded the plugin and activated it.

I have this in my page:

<txp:adi_link ext_link="1"> <txp:linklist wraptag="p" /> </txp:adi_link>

The links are referencing to be external as I need them to be:

<p class="linklist"><a class="ext_link" rel="external" href="http://www.tartanweb.org/designer/designer.php" title="Create your own plaid with this easy to use FREE web application.">Tartan Designer</a>

The links do not open in a new window.

The docs reference:

$(document).ready(function(){ $('a[rel="external"]').each(function() { $(this).attr('target', '_blank'); }); });

How do I use this?

I made a .txt document and renamed it external.js and put that code in it. I then referenced the path to it in my header like this:

<script type="text/javascript" src="<txp:site_url />js/external.js"></script>

Apparently this is not what I should do because the links are still opening in the same window. Other scripts I’m using work, so not sure what I missed with the adi_links. No joy with latest version FireFox and Safari. Any help appreciated. Thanks.

Offline

#19 2011-07-11 16:59:47

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,304
Website

Re: adi_link – Enhanced links

aliceaod wrote:

Total newb here so forgive me for sounding so stupid.

That’s OK. I’m in the wrong place to answer your question coherently but are you loading jQuery itself properly?

Something like:

<script type="text/javascript" src="textpattern/jquery.js"></script>

Also, adi_link wants a URL when in container mode, so:

<txp:adi_link ext_link="1"> <txp:linklist wraptag="p" /> </txp:adi_link>

probably might work better as:

<txp:adi_link id="x" ext_link="1" />

where “x” is the ID of the link you’ve stored in the Links tab.

Offline

#20 2011-07-12 00:54:54

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: adi_link – Enhanced links

I did not have the call to jquery in my header, so added it.

I put <txp:adi_link id="x" ext_link="1" /> in my page. The link was displayed, but no joy. It still opened in the same window. The link looks like this in the source code: <a href="http://handweaving.net/Patterns.aspx" title="Weaving Drafts" rel="external" class="ext_link">Weaving Drafts</a>

I was hoping that adi_link would make all the links in the links tab open in a new window since I’ll be using the links tab for nothing but external links.

The links in the list are showing with the class and rel, they’re just not opening in a new window and I can’t figure out why. :S

In the meantime I created a form for “external_links” and hand coded each link with invalid target=”_blank” in the code. This defeats the purpose of having the links tab, I’d rather use the links tab.

Last edited by aliceaod (2011-07-12 02:08:52)

Offline

#21 2011-07-12 07:16:35

gomedia
Plugin Author
Registered: 2008-06-01
Posts: 1,304
Website

Re: adi_link – Enhanced links

aliceaod wrote:

I was hoping that adi_link would make all the links in the links tab open in a new window since I’ll be using the links tab for nothing but external links.

adi_link generates the basic markup but it’s jQuery that sets up the “open in a new window” bit (i.e. adding the target="_blank" attribute) – so that’s where you need to look for problems.

I’m travelling at the moment, so my assistance is limited. Sorry.

Offline

#22 2011-07-13 06:32:10

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: adi_link – Enhanced links

No worries…I am in development and am taking my time. Be safe in your travels.

adi is formatting the links correctly, it’s just that for some reason jquery in textpattern doesn’t seem to be working. I just tried to use the comments popup and not even that is opening in a new window or “popping up”, so I’ll check into any plug-in or script conflicts.

Note: the shadowbox in admin panel works just fine (the thing where it dims the page when you go to delete something and it asks you if you’re sure you want to do that). I use a similar script for images, which works…I’m going to try reinstalling textpattern and see what happens. There’s no reason I can find for why the popup /open in different window/tab doesn’t work.

Last edited by aliceaod (2011-07-13 06:44:01)

Offline

#23 2011-07-13 07:09:48

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: adi_link – Enhanced links

Wow, must be something on my end or an issue with textpattern. I just did a fresh install of textpattern, turned on the popups for the comments and it opened in the same window. Odd since jquery does work on other projects I have. Thanks anyways. I hope i can get this to work cos I think this plugin is awesome.

Offline

#24 2011-07-13 07:51:44

aliceaod
Member
Registered: 2011-07-11
Posts: 18

Re: adi_link – Enhanced links

I had my browser prefs set to open new windows in a new tab (facepalm), so when I turned that off the comments popup worked, however, the adi_link is still not opening in a new window or tab. I’ll keep trying. I’ll let you know if/when I ever get this to work.

Offline

Board footer

Powered by FluxBB