Re: [Lucee] How to output HTML

57 views
Skip to first unread message

Mark Drew

unread,
Jul 7, 2016, 12:45:57 PM7/7/16
to lu...@googlegroups.com

For UI stuff custom tags are great, I tend to not use the <cf_ notation though and use

<cfimport taglib="/tags/ui/"            prefix="ui" />

and then:

<ui:table ...>
  <ui:row ...>
    <ui:cell> [contents] </ui:cell>
    <ui:cell> [contents] </ui:cell>
    <ui:cell> [contents] </ui:cell>
  </ui:row ...>
  [repeated rows]
</ui:table>

<ui:container ...>
  [contents]
</ui:container>

<ui:dropDown ..>

<ui:avatarBox ...>
  [contents]
</ui:avatarBox>

Which looks (to me) a lot cleaner

and you saved yourself some characters :)

HTH




Mark Drew

develop • deploy • deliver


On 7 July 2016 at 17:41:55, Peter Jackson (p...@pkjackson.plus.com) wrote:

In our application, we use a lot of custom tags to render the page HTML and we have tags that correspond to all our standard UI components, such as tables, drop downs, containers, sortable lists, forms etc.

For example:

<cf_ui_table ...>
  <cf_ui_row ...>
    <cf_ui_cell> [contents] </cf_ui_cell>
    <cf_ui_cell> [contents] </cf_ui_cell>
    <cf_ui_cell> [contents] </cf_ui_cell>
  </cf_ui_row ...>
  [repeated rows]
</cf_ui_table>

<cf_ui_container ...>
  [contents]
</cf_ui_container>

<cf_ui_dropDown ..>

<cf_ui_avatarBox ...>
  [contents]
</cf_ui_avatarBox>

These work extremely well and allow us to capture the data in a natural way and output consistent HTML the UI.  If we want to change the HTML that's rendered, we can do so in one place.  Tags like the <cf_ui_table> handle extra functionality such as paging, sorting etc.

We've stuck with custom tags because they can easily capture the content, output it at an appropriate place, and make decisions on it.

Is there a better way?

 



--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/4ba47db9-a499-4761-920a-4714971d6b29%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Peter Jackson

unread,
Jul 11, 2016, 4:02:20 AM7/11/16
to Lucee
Thanks Mark.

Nice to know that others are using the same approach.  The cfimport notation looks nicer but I'm put off by having to do the cfimport on every page.

Mark Drew

unread,
Jul 11, 2016, 5:03:18 AM7/11/16
to lu...@googlegroups.com
To be honest, you get used to it the syntax alone is worth it. 

Mark Drew
- Sent by typing with my thumbs. 

On 11 Jul 2016, at 09:02, Peter Jackson <p...@pkjackson.plus.com> wrote:

Thanks Mark.

Nice to know that others are using the same approach.  The cfimport notation looks nicer but I'm put off by having to do the cfimport on every page.

--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.

Mark Drew

unread,
Jul 11, 2016, 5:03:56 AM7/11/16
to lu...@googlegroups.com
It also means you can group stuff much better


Mark Drew
- Sent by typing with my thumbs. 

On 11 Jul 2016, at 09:02, Peter Jackson <p...@pkjackson.plus.com> wrote:

Thanks Mark.

Nice to know that others are using the same approach.  The cfimport notation looks nicer but I'm put off by having to do the cfimport on every page.

--
Win a ticket to dev.objective from Lucee via Twitter, see http://bit.ly/1UbTMWj for details, good luck and see you there...
---
You received this message because you are subscribed to the Google Groups "Lucee" group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+un...@googlegroups.com.
To post to this group, send email to lu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages