Ed Johnson wrote on 19 Sep 2009 06:56
I was working on the photo gallery template to edit the deprecated variables and ran into a problem. I'm using Erich's nifty sortable page list, but the page that sets up the URL parameters doesn't work right because of the space in between the sort order cirteria and "desc". I tried replacing the spaces with %20, but still no joy. Here's the before and after of the page that's broken. I have reverted it back for now until this can be solved.
The page with the issue
http://photo-gallery-template.wikidot.com/include:list-pages-prepend
Current working code (this is all one long line)
[[table]][[row]][[cell style="{$styleT}"]]//Gallery//[[/cell]][[cell style="{$styleA}"]]//Created by//[[/cell]][[cell style="{$styleE}"]]//Last Edited//[[/cell]][[cell style="{$styleC}"]]//Date Created//[[/cell]][[cell style="{$styleR}"]]//Rating//[[/cell]][[/row]][[row]][[cell style="{$styleT}"]][[size 80%]][/{$page}/order/titleAsc#A_{$anchor} ascending]/[/{$page}/order/titleDesc#A_{$anchor} descending][[/size]][[/cell]][[cell style="{$styleA}"]][[size 80%]] [[/size]][[/cell]][[cell style="{$styleE}"]][[size 80%]][/{$page}/order/dateEditedDesc#A_{$anchor} newest first]/[/{$page}/order/dateEditedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[cell style="{$styleC}"]][[size 80%]][/{$page}/order/dateCreatedDesc#A_{$anchor} newest first]/[/{$page}/order/dateCreatedAsc#A_{$anchor} oldest first][[/size]][[/cell]][[cell style="{$styleR}"]][[size 80%]][/{$page}/order/ratingDesc#A_{$anchor} ▼]/[/{$page}/order/ratingAsc#A_{$anchor} ▲][[/size]][[/cell]][[/row]]
Attempt to replace deprecated arguments and variables
[[table]][[row]][[cell style="{$styleT}"]]//Gallery//[[/cell]][[cell style="{$styleA}"]]//Created by//[[/cell]][[cell style="{$styleE}"]]//Last Edited//[[/cell]][[cell style="{$styleC}"]]//Date Created//[[/cell]][[cell style="{$styleR}"]]//Rating//[[/cell]][[/row]][[row]][[cell style="{$styleT}"]][[size 80%]][/{$page}/order/title#A_{$anchor} ascending]/[/{$page}/order/title%20desc#A_{$anchor} descending][[/size]][[/cell]][[cell style="{$styleA}"]][[size 80%]] [[/size]][[/cell]][[cell style="{$styleE}"]][[size 80%]][/{$page}/order/updated_at%20desc#A_{$anchor} newest first]/[/{$page}/order/updated_at#A_{$anchor} oldest first][[/size]][[/cell]][[cell style="{$styleC}"]][[size 80%]][/{$page}/order/created_at%20desc#A_{$anchor} newest first]/[/{$page}/order/created_at#A_{$anchor} oldest first][[/size]][[/cell]][[cell style="{$styleR}"]][[size 80%]][/{$page}/order/rating%20desc#A_{$anchor} ▼]/[/{$page}/order/rating#A_{$anchor} ▲][[/size]][[/cell]][[/row]]
I'm going to PM the brains behind this code to see if he can help.
-Ed
After a PM exchange with Erich, it seems my code was fine after all. I think I may have had a caching issue (even though I'm sure I cleared it before reporting the problem). I put my new code back in and now i can't recreate the issue I was having last night. Bottom line is that the sortable list pages is working correctly and all deprecated variables and arguments have been updated.
-Ed
Community Admin
Glad to hear it's working. Caching sometimes affects page display; more often it's the asynch compilation that creates confusion: when you edit a _template it can take a minute or so for all affected pages to be recompiled.
Portfolio
I like your unique way of showing the code :) I assume that the [[code]] tags can be edited with CSS to make this happen every time, similar to how James edited the > Quote recently?
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
Yes you just change/add the relevant properties and values to the .code class in your custom CSS.
Rob
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
Thanks, will have a look at that later with firebug :)
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
I wasn't really that clever. I sometimes bypass the built-in code block and "roll my own", especially when it will be virtually unreadable due to the never-ending horizontal scroll box the normal code block would have created for something like the code I pasted in the opening message in this thread.
Here's what I did:
insert code in here
This can also be handy for adding color or other highlights to your code block, for example:
some code display this as red the rest of the code
Note that @@ … @@ is only good for inline bypassing of the parser. If your code has multiple lines, you need to do @@ … @@ at the start and end of each line.
-Ed
Community Admin
To wrap the code onto the next line so that the never-ending scrollbar doesn't appear, put this into your CSS:
Rob
Rob Elliott - Strathpeffer, Scotland - Wikidot first line support & community admin team.
That's handy to know. Thanks! I'll be implementing that on my open source site. Personally, I think it's easier to copy/paste code that is wrapped.
My "tip" is geared more toward "on the fly" editing to display code in a more controlled manner (and the text highlighting is a bonus too).
-Ed
Community Admin
Most of you will already know this, but then I don't remember if I ever posted this …
Display code as if [[code]] was used
Sometimes you want to display code without using the [[code]] tag, e. g.
That's possible by using below syntax:
[/test:code/code/n code/n1]
code/1
[[include include:test]]
Restriction
Unlike [[code]], [[div class="code"]] will strip off all leading white-space from lines, thus removing any indentation from the displayed code.
Thank you for posting this Erich. Your timing could not have been much better for me - I have just used this trick, after reading about it here!
This looks nice enough to go into the standard themes. Anyone mind if I do that?
Portfolio
Yes, I would mind! The beauty of the scrollbar is that I know exactly where one line starts and another begins. Word-wrapping makes this ambiguous.
Although, I suppose all I'd have to do to reverse the option with my custom CSS, so ultimately it doesn't matter.
I agree with James — the scrollbar is useful most of the time. It's just that sometimes, I'd prefer this style for one or two of my sites.
~ Leiger - Wikidot Community Admin - Volunteer
Wikidot: Official Documentation | Wikidot Discord server | NEW: Wikiroo, backup tool (in development)
No problem.
Portfolio