Jump to content

PageReference problem: renders wrong url


RuiVP
 Share

Recommended Posts

I have an input field PageReference in my templates. It is meant to work as tags and it references pages with a «etiquete» (=tag) template. I can input new references and they render fine in the page, but the url renders wrong. As an exemple, I get:

<a href='/mysite/mytags/sometag/>'>sometag</a>

instead of

<a href='/mysite/mytags/sometag/'>sometag</a>

I'm building the site in a Wamp local server. Working with PW 3.x

Is it a bug or may I be doing something wrong?

Link to comment
Share on other sites

Oh my... My mistake, the bug was on me...

Please forget this message or, even better, erase it, to avoid my shame.

Just to clarify: I am using the same function in several templates, to render the tags, and the bug was in there:

function commatedList(PageArray $items) {
	$out = "";
	if($items) {
		foreach ($items as $item) {
			if($item == $items[0]) {
				$out .= "<a href='{$item->url}'>{$item->title}</a>";
			}
			else { $out .= ", <a href='{$item->url}'>{$item->title}</a>"; }
		}
	}
	return $out;
}

As you can imagine, the problem was:  $out .= "<a href='{$item->url}>'>{$item->title}</a>";

Also: it may be bad programming, I know, but anyway I'm not a programmer, so...

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...