Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-11-26 09:38:33

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

[SOLVED] content appears twice

What am I doing wrong here? I have all the authors in the links which I parse in a custom field in the write tab. the problem is that if their name is not linked it appears twice on the page.

Sample of the bug in the code can be seen on the right side-bar.

<div class="grid_6" id="side" role="complementary">
<div itemscope itemtype="http://schema.org/Person" id="meta">
<p class="linklist">Text by <txp:linklist id='<txp:custom_field name="venue" escape="" />' break=" &amp; " wraptag="">
<txp:variable name="linkurl" value='<txp:link_url />' />
<txp:if_variable name="linkurl" value="">
<span itemscope itemtype="http://schema.org/Text"><span itemprop="author"><txp:link_name /></span></span><span itemprop="author"><txp:link_name /></span></span>
<txp:else />
<a rel="author external" href="<txp:link_url />"><txp:link_name /></a>
</txp:if_variable>
</txp:linklist></p>
<time class="published" datetime="<txp:posted format="%Y-%m-%dT%T" />">
Posted: <txp:posted format="%b %d, %Y" /></time>
</div>

Solved! Posing here is enough for bugs to be found.

Last edited by colak (2017-11-26 10:01:09)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#2 2017-11-26 10:01:00

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

Re: [SOLVED] content appears twice

Hi Yiannis, I think it’s just a copy-paste error. You simply have the code in there twice:


...
<span itemscope itemtype="http://schema.org/Text">
  <span itemprop="author"><txp:link_name /></span>
</span>
  <span itemprop="author"><txp:link_name /></span>
</span>
...

(I just added enters to make it easier to see)


TXP Builders – finely-crafted code, design and txp

Offline

#3 2017-11-26 10:01:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

Re: [SOLVED] content appears twice

jakob wrote #307999:

Hi Yiannis, I think it’s just a copy-paste error. You simply have the code in there twice:

...

(I just added enters to make it easier to see)

Indeed I found it as you were typing:)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#4 2017-11-26 10:02:56

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

Re: [SOLVED] content appears twice

Yep, it’s working now ;-)


TXP Builders – finely-crafted code, design and txp

Offline

#5 2017-11-26 10:42:55

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,032
Website GitHub Mastodon Twitter

Re: [SOLVED] content appears twice

the forum always does it for me. I guess it has the same effect as looking at a design sideways. You get a view which is unfamiliar to you and all the mistakes show up.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#6 2017-11-26 19:15:53

gaekwad
Server grease monkey
From: People's Republic of Cornwall
Registered: 2005-11-19
Posts: 4,150
GitHub

Re: [SOLVED] content appears twice

colak wrote #308002:

the forum always does it for me. I guess it has the same effect as looking at a design sideways. You get a view which is unfamiliar to you and all the mistakes show up.

See also rubber duck debugging — it works for me a lot. I have an actual rubber duck on my desk, too…

Offline

Board footer

Powered by FluxBB