Ticket #239 (closed enhancement: completed)

Opened 13 months ago

Last modified 7 months ago

New "a" tag for the view taglib

Reported by: kurtwiersma Owned by: peterfarrell
Priority: minor Milestone: Mach-II 1.8.0 alpha
Component: framework - custom tags Version: 1.8.0 - Framework
Keywords: view tag library lib a href buildUrl buildRoute buildUrlToModule Cc: kurtwiersma, pixelist@…
Blocking: Blocked By:

Description

I talked to Peter online and we thinking of building a new tag in view taglib for outputting links (a tags). This tag would support buildURL or buildRouteUrl and allow you to pass url parameters via sub tags.

Attachments

Change History

  Changed 13 months ago by peterfarrell

  • keywords view tag library lib a href buildUrl buildRoute buildUrlToModule added
  • owner changed from kurtwiersma to peterfarrell
  • status changed from new to assigned

Here are a couple of examples of syntax I'm thinking about:

<cfimport prefix="view" taglib="/MachII/customtags/view" />
<view:a event="foo" p:productId="10">Check out product 10</view:a>
<view:a route="showProduct" p:productid="10">Check out product 10</view:a>

Optionally support a label attribute so you don't have to wrap the link text in the custom tag if you don't want to:

<view:a event="foo" p:productId="10" label="Check out product 10" />
<view:a route="showProduct" p:productid="10" label="Check out product 10" />

  Changed 13 months ago by peterfarrell

  • cc kurtwiersma, pixelist@… added; peterfarrell removed

  Changed 13 months ago by peterfarrell

[None] - Initial commit (still needs documentation)n- refs #239

follow-up: ↓ 6   Changed 13 months ago by peterfarrell

Jonah, FYI got a rough version of the a tag in the view tag library. Supports:

  • All standard HTML attributes
  • All event attributes
  • Non-standard attributes via the x: namespace
  • Adding url parameters using the p: namespace
  • Adding query string parameters (when using routes) using the q: namespace

Still need to add attributes called x, p and q so we can support name / value pair pipe lists or structs (collections of attributes or parameters).

Special tag attributes:

  • event indicates the event name
  • module indicates the module name (optional)
  • route indicates route name (cannot be used with event and/or module)
  • label to indicate the link text if you use a self-closing tag instead of setting the link text between a opening and closing tag manually

  Changed 13 months ago by peterfarrell

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

[None] - Added attributes for url params, for query string params and for non-standard attributesn- Feature complete and ready for user testing (Still need documentation)n- closes #239

in reply to: ↑ 4   Changed 13 months ago by .jonah <jonah.mach-ii@…>

Replying to peterfarrell:

* Non-standard attributes via the x: namespace

This is great when you're using functions like  http://prototypejs.org/api/element/readAttribute.

A question though: what version of (X)HTML are you supporting with the "standard HTML attributes"? Might this be a moving target?

Note: This affects the form tag library as well.

  Changed 13 months ago by peterfarrell

Basically we have to support HTML and XHTML. Shooting for HTML 4.1 and XHTML 1 which are the standards at this point. For example, we support target attribute even though that is not valid XHTML. Basic I use what is listed on W3CSchools for each tag (which is accurate and easier to read than the W3C specs):

 http://www.w3schools.com/tags/tag_a.asp

For "standard" attributes (meaning these are the common attributes across most tags), I mean these:  http://www.w3schools.com/tags/ref_standardattributes.asp

For "event" attributes, I mean these (if applicable):  http://www.w3schools.com/tags/ref_eventattributes.asp

Thanks for a reminder on the non-standard attribute namespace for the form tags. I need to file a ticket to remind myself.

  Changed 13 months ago by peterfarrell

FYI, support for non-standard attributes was added to the form tag lib in #243.

  Changed 13 months ago by peterfarrell

  • status changed from closed to reopened
  • resolution fixed deleted

We need to support using BuildCurrentUrl? as well. Kurt, since you're familiar with that API (the M2SFP doco needs to be updated with that info), I'm going to assign that ticket to you.

  Changed 13 months ago by peterfarrell

  • owner changed from peterfarrell to kurtwiersma
  • status changed from reopened to new

  Changed 13 months ago by peterfarrell

  • owner changed from kurtwiersma to peterfarrell
  • status changed from new to assigned

During the team meeting we discussed adding support for adding buildCurrentUrl to the a tag. We decided on adding this via a boolean flag called useCurrentUrl.

  Changed 13 months ago by peterfarrell

  • component changed from framework - util to framework - custom tags

  Changed 13 months ago by peterfarrell

- refs #239

  Changed 13 months ago by peterfarrell

  • status changed from assigned to closed
  • resolution set to completed

Added in changeset:1385

Add/Change #239 (New "a" tag for the view taglib)

Author


E-mail address and user name can be saved in the Preferences.


Action
as closed
Next status will be 'reopened'
 
Note: See TracTickets for help on using tickets.