Let say, I put the click here in the Contemplate,
and the Contemplate output the click here

the reason I ask because I have links in CCK text type.
Let me know if there a way to do it.
thanks all.
John,

Comments

johnking’s picture

Let say, I put the <go href="RAWLINKS" title="rawlinks">click here </go>
in the Contemplate,
and the Contemplate output the

<a href="Go/Prettylinks" > click here <a/>

the reason I ask because I have links in CCK text type.
Let me know if there a way to do it.
thanks all.
John,

hass’s picture

Status: Active » Fixed

If you are able to setup a filter for CCK, than it may work. Otherwise you need to write a patch.

lemmers’s picture

I am also trying to get gotwo to work with contemplate.

I have a url stored in a CCK text field.

In contemplates, I'm trying to display the url using this code:

<go href="<?php print $node->field_linktext[0]['view'] ?>">Click this link</go>

If I use "a" tags, the link works fine. With the above code, if I view the page source I can see the go tags, but the link appears in plain text.

I've tried every combination of input formats I could think of. I added the go tag to the default import format list of allowed tags and I also hacked the cck module and changed line 1755 to the following to allow for the go tag, thinking this could be the problem

function _content_filter_xss_allowed_tags() {
  return array('go','a', 'b', 'big',  'code', 'del', 'em', 'i', 'ins',  'pre', 'q', 'small', 'span', 'strong', 'sub', 'sup', 'tt', 'ol', 'ul', 'li', 'p', 'br', 'img');

Nothing I do seems to work. Love this module, but really, really, really need this functionality.

Am I missing something here. Is there a way to get this to work?

lemmers’s picture

I thought I had this working using check_markup in contemplate, but it's still not working correctly. I'll continue to try different things. If anyone understands what I'm trying to do and can provide assistance I'd appreciate it.

hass’s picture

I'm not using contemplate myself, but it sounds like the filters may run earlier and you only get the filtered variables if you use them in the templates. In this case you are out of luck. If the contemplate is not filtered the go link cannot replaced. Maybe a limitation of contemplate... But i'm only guessing.

lemmers’s picture

Thanks for your response. I think I got it working correctly. One problem I ran into is that the page had to be refreshed for the redirect to show. I think upgrading to the latest dev version solved that.

This is the code I'm using in contemplates and it seems to be working. (I'm sure there's a better way as I really don't know what I'm doing). The url is stored in a cck textfield field_linktext.

<?php print check_markup('<go href="' . $node->field_linktext[0]['value'] . '" title="' . $node->field_companyid[0]['view'] . '">TestGo</go>', 1) ?>
hass’s picture

This is the bug #936468: Go link only shows after clearing cache or changing input filter. I may publish an updated release soon.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.