Developer forum

Forum » Templates » Data Lists with custom layout

Data Lists with custom layout


Reply
Using Data Lists for managing a table in the database where it is possible to add and edit the rows.

Edit Data:
Forms page = set to specific page
Display 'add row' link = checked
Display 'edit row' link = checked

Publishing options:
Show link to detail view
= checked
Show headings = checked
Sortable columns = checked

Layout:
Using one of the standard layouts eg. blue, green etc works fine, but looks really bad.
Using Custom and defining a .xlst for the list and the detail view changes the output.
On the list - the link to the details page works fine, but then the "edit-row" button is gone. And the "add row" button is also gone on the list.

Checking the TagList for Data Lists it does not look like anything is exposed regarding the above selected checkboxes.

And did not find the default layout files anywhere, assuming they actually show what tags can be used.

The real question:
How do I get the values in my XSLT for list/details respectively, so I can add the "add row" button with the correct target. The "edit row" with the entered value in "forms page" with the correct attributes to pull the correct record for editing.

Any pointers appreciated.


Replies

 
Jeppe Eriksson Agger Dynamicweb Employee
Jeppe Eriksson Agger
Reply
You are correct in that there's no premade link for those two actions. However the values needed are there.

First: The "Add new row" link is just a link to the Forms page. That link is available through the tag "Forms.Page".
For XSLT you would probably want to do a test on the tag "Forms.Page.NewLink". If the value equals "1" then the checkbox was checked in backend.

Second: The "Edit row" link needs some composition. The base link is still the "Forms.Page" tag and onto that you need to append "&FORM_ROW_ID={0}&VIEW_ID={1}". Replace {0} with the value of the tag "RowId" and replace {1} with the value of the tag "ViewId". That link will give you the "Edit row" link.
For XSLT you would probably want to do a test on the tag "Forms.Page.EditLink". If the value equals "1" then the checkbox was checked in backend.

- Jeppe
 
Reply
Ahh, I see now.

Works like a charm, did a <xsl:copy-of select="." /> and could then see all the exposed XML. Brilliant.

 

You must be logged in to post in the forum