Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-13 19:22:22

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

anchors in tables?

I have anchors created in tables rather than divs, however, it does not work using tables but divs. is there a way to get them working in tables?


<txp:Ruhh />

Offline

#2 2008-05-14 16:18:29

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: anchors in tables?

Can’t you put a “div” inside a table?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2008-05-14 16:36:35

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: anchors in tables?

There’s a div inside the table but whenever it is within a table, anchors don’t work that way.


<txp:Ruhh />

Offline

#4 2008-05-14 16:43:41

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: anchors in tables?

When I do this (in an article) it works:

|this|is a|table|row|
|(#anchor). here|the|second|row|

It produces this html:

	<table>
		<tr>
			<td>this</td>
			<td>is a</td>
			<td>table</td>
			<td>row</td>
		</tr>
		<tr>
			<td id="anchor">here</td>
			<td>the</td>
			<td>second</td>
			<td>row</td>

		</tr>
	</table>

Offline

#5 2008-05-14 16:46:27

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: anchors in tables?

Why should this not work?

"link to row-id1":#id1
"link to cell-id2":#id2
(#id1). |(#id2). 1|2|
|3|4|
|5|6|

Or is this not what you mean?


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#6 2008-05-14 16:47:16

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: anchors in tables?

Ah, Els was a bit faster. :)


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#7 2008-05-14 16:49:02

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: anchors in tables?

Really? I will show my code here:

This is what I have in my page template consisting of the form to call.

<table cellpadding="5px"><tr>
<td width="150px" valign="top"></td>
<td><txp:article_custom form="post_list" section="post" limit="99" /></td>
</tr></table>

And the post_list form:

<txp:if_different>
<h1>2008 Archive</h1>
<br />
</txp:if_different>
<txp:if_different>
<br />
<h3 id="<txp:posted format="%B" />"><txp:posted format="%B" /></h3>
</txp:if_different>
<font color="#666"><txp:posted format="%d:" /></font> <txp:permlink><txp:title /></txp:permlink>
<br />

<txp:Ruhh />

Offline

#8 2008-05-14 16:52:05

trenc
Plugin Author
From: ⛵️, currently Göteborg, SE
Registered: 2008-02-27
Posts: 574
Website GitHub

Re: anchors in tables?

Are you sure the id (date in your case) is always unique?


Digital nomad, sailing the world on a sailboat: 32fthome.com

Offline

#9 2008-05-14 16:58:17

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: anchors in tables?

Does it have to be a table? And do you really want your article list in one table cell? Because that is what your code does.
Also, what is the first if_different supposed to do? It won’t do anything if there is no txp tag inside ;)

Offline

#10 2008-05-14 16:59:55

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: anchors in tables?

trenc wrote:

Are you sure the id (date in your case) is always unique?

It should be when using if_different… at least when there is only one year on the page.

Offline

#11 2008-05-14 17:04:26

Ruhh
Member
From: dakota dunes
Registered: 2008-01-20
Posts: 305

Re: anchors in tables?

I am pretty confused. Yes I need the tables because my articles are in the right side of the table whereas the dynamic sidebar goes in the left side of the table. I have an archive page containing the month+year dates that are linkable to the yearly archive page consisting of the posts under each month that’s called in the link.

This is what the link looks like:

<a href="<txp:site_url />archive/2008#<txp:posted format="%B" />"><txp:posted format="%B&nbsp;%Y" /></a>

<txp:Ruhh />

Offline

#12 2008-05-14 17:16:17

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: anchors in tables?

Well in my opinion two divs (one floating) would be better, but that is up to you :)

When I put a <h3 id="whatever"> in a table cell, the anchor still works. Maybe it’s a browser issue, I seem to remember that IE once had difficulties with anchors other than <a name="anchor"> :)

Offline

Board footer

Powered by FluxBB