Using contents of fields in a template html attribute

(5 posts) (2 voices)

Tags:

No tags yet.

  1. maron, Member

    I have this code in a template

    <div class="item #id"> <div class="nr">#nr</div> <div class="customer_firstname">#customer_firstname</div> <div class="timi">#timi</div> <div class="name">#name</div> <div class="product_options">#product_options</div> </div>

    I am trying to get an order id into the class of the parent div - however #id parses as
    <span class=" hdr_show"="">2,214">
    When all I want is 2214

    Is there any way to tell the template to skip the additional span for just that one element - something like ##id and I would just get the raw data in the template?

    Regards,
    Maron

    Posted 5 years ago #
  2. myDBR Team, Key Master

    Do you have myDBR commands applied to the data passed on to the template? How does your template usage look like?

    --
    myDBR Team

    Posted 5 years ago #
  3. maron, Member

    select 'dbr.colstyle','nr', '%d'; select 'dbr.hdr', 1,2,3,4; select 'dbr.report','sp_DBR_change_order_status','[nr]','popup','inOrderId=nr'; select 'dbr.hidecolumn','status'; select 'dbr.keepwithnext'; select 'dbr.template','#MenuItem'; select o.entity_id as id, o.entity_id as nr, o.customer_firstname, DATE_FORMAT(o.created_at, '%H:%i') as timi, o.status, it.name, it.product_options ...

    Posted 5 years ago #
  4. myDBR Team, Key Master

    Hi,
    As the o.entity_id is part of the header it inherits the header formatting (albeit myDBR internal one). The easiest way is to select o.entity_id again as a extra column and apply %d formatting for it. No need to hide it (same goes with status), as you are using a template.

    --
    myDBR Team

    Posted 5 years ago #
  5. maron, Member

    Excellent - thanks. moving o.entity_id last works perfectly - now on to some jquery magic.

    Posted 5 years ago #

Reply

You must log in to post.