by
Musman » Thu Feb 12, 2015 6:19 pm
Hello, just a small issue that I discovered during looking through Tutorial files..
In the file "pads/page_view.html":
- Code: Select all
<cms:pages masterpage='pads.php' id=rt_id limit='1' show_future_entries='1'>
<cms:set my_current_pad=k_page_title 'global' />
<cms:set my_current_pad_name=k_page_name 'global' />
<cms:set my_current_pad_id=k_page_id 'global' />
<cms:set my_total_records='0' 'global' />
</cms:pages>
<cms:capture into='my_content' >
<table class="notes">
<tr>
<th class="note">Note <a href="<cms:add_querystring k_page_link 'sort=name' />" class="sort_arrow" >↑</a><a href="<cms:add_querystring k_page_link 'sort=-name' />" class="sort_arrow" >↓</a></th>
<th>Pad</th>
<th class="date">Last modified <a href="<cms:add_querystring k_page_link 'sort=date' />" class="sort_arrow" >↑</a><a href="<cms:add_querystring k_page_link 'sort=-date' />" class="sort_arrow" >↓</a></th>
</tr>
...
This type of sorting (using k_page_link) is nice for 'notes/list_view.html', but for Pads I suppose it should be:
- Code: Select all
<cms:pages masterpage='pads.php' id=rt_id limit='1' show_future_entries='1'>
<cms:set my_current_pad=k_page_title 'global' />
<cms:set my_current_pad_name=k_page_name 'global' />
<cms:set my_current_pad_id=k_page_id 'global' />
<cms:set my_current_pad_link="<cms:route_link 'page_view' rt_id=my_current_pad_id />" 'global' />
<cms:set my_total_records='0' 'global' />
</cms:pages>
<cms:capture into='my_content' >
<table class="notes">
<tr>
<th class="note">Note <a href="<cms:add_querystring my_current_pad_link 'sort=name' />" class="sort_arrow" >↑</a><a href="<cms:add_querystring my_current_pad_link 'sort=-name' />" class="sort_arrow" >↓</a></th>
<th>Pad</th>
<th class="date">Last modified <a href="<cms:add_querystring my_current_pad_link 'sort=date' />" class="sort_arrow" >↑</a><a href="<cms:add_querystring my_current_pad_link 'sort=-date' />" class="sort_arrow" >↓</a></th>
</tr>
Using "my_current_pad_link" value.
UPD: and also, just for accuracy, in the files discussed above ("pads/page_view.html", 'notes/list_view.html') the lines
- Code: Select all
<cms:no_results>
<tr colspan='3'>
<td><p>No notes created yet.</p><td>
</tr>
</cms:no_results>
should be replaced with
- Code: Select all
<cms:no_results>
<tr>
<td colspan='3'><p>No notes in this pad yet.</p></td>
</tr>
</cms:no_results>
Unclosed <td> and wrong colspan caused some errors in my testing workaround... Yes, it's a small issue and the design is just for testing, but if it will be public-accessible, why not make it perfect)
Thanks!