Ticket #729 (closed enhancement: fixed)

Opened 19 months ago

Last modified 19 months ago

Added rel-tag microformat to tags in Elgg.

Reported by: jonkemp Owned by:
Priority: high Milestone:
Component: Core Version: 1.2
Severity: major Keywords:
Cc: brettp

Description

Modification of Rev. #2627.

Designating tags as tags in Elgg by using the tag Microformat. For reference see:

 http://microformats.org/wiki/rel-tag

"By adding rel="tag" to a hyperlink, a page indicates that the destination of that hyperlink is an author-designated "tag" (or keyword/subject) for the current page."

Attachments

2627_rel_tag.diff Download (1.0 KB) - added by jonkemp 19 months ago.
Rewrote the tag url to comply with the microformat specification and added .htaccess rewriterule.

Change History

  Changed 19 months ago by jonkemp

Just noticed that tags in Elgg do not follow the tag mciroformat. Here is the code for tags in Elgg.

<a href=" http://www.example.com/search/?tag=elgg" rel="tag">Elgg</a>

This is what the microformat specification states.

Tags may only be placed in the URL path, and only in the last segment of the path. Tags may not be placed in query parameters or fragment identifiers.

This is the correct format called for in the specification.

<a rel="tag" href=" http://example.com/tag/elgg">Elgg</a>

So tag urls need to be rewritten in Elgg to correctly follow the specification. But they still require the rel="tag" attribute.

  Changed 19 months ago by jonkemp

I rewrote the tag url format to follow the microformat specification and I added a rewriterule to .htaccess to handle the url and still display the tag.

Changed 19 months ago by jonkemp

Rewrote the tag url to comply with the microformat specification and added .htaccess rewriterule.

follow-up: ↓ 4   Changed 19 months ago by jonkemp

Actually, the code above is wrong, here is what I meant it to be.

Here is the code for tags in Elgg.

<a href=" http://www.example.com/search/?tag=elgg">Elgg</a>

This is the correct format called for in the specification.

<a rel="tag" href=" http://example.com/tag/elgg" rel="tag">Elgg</a>

The correct format should have rel="tag" and Elgg currently does not.

in reply to: ↑ 3   Changed 19 months ago by jonkemp

Replying to jonkemp:

Argh, wrong again. Here is what it should be.

This is the correct format called for in the specification.

<a href=" http://example.com/tag/elgg" rel="tag">Elgg</a>

Anyway, the diff file I posted has the correct code.

  Changed 19 months ago by ben

  • status changed from new to closed
  • resolution set to fixed

(In [2642]) Tag URLs now conform to the microformats specification. Fixes #729

  Changed 19 months ago by ben

This has been merged in, although I rewrote the rewrite rule to only match tag/ (as I wasn't confident it wouldn't match other URLs we might use in the future).

  Changed 19 months ago by jonkemp

  • status changed from closed to reopened
  • resolution fixed deleted

Line 128 needs to be rewritten from this.

RewriteRule ^tag/([A-Za-z0-9\+-]+)/?$ search/?tag=$2

to this

RewriteRule ^tag/([A-Za-z0-9\+-]+)/?$ search/?tag=$1

  Changed 19 months ago by ben

  • status changed from reopened to closed
  • resolution set to fixed

Whoops, well spotted! Corrected.

Note: See TracTickets for help on using tickets.