Page 1 of 1

Additional export options/keys

Posted: Sat Dec 12, 2009 1:17 pm
by marumari
I have a couple export feature requests; hoping they'll be pretty easy to add in.

Adding a meta option to override the user-set date format, such as this:

Code: Select all

<meta name="dateFormat" content="[string]" />
<meta name="dateFormat" content="%Y-%m-%d" /> (example)
This would allow you to put it in a more sortable format (2009-11-23) than the default (Nov 2009).

Also, adding a couple keys:

Code: Select all

[key:coverImageURLHeight]
[key:coverImageURLWidth]

<img src="[key:coverImageURL]" height="[key:coverImageURLHeight]" width="[key:coverImageURLWidth]" />
Currently, you can set a max height (image-height) and a max width (image-width), but you don't know if the resultant image will be the max-height, the max-width, both, or smaller than both. This would be helpful not just in my template. Something like the Covers template would load much smoother if the browser could lay the page out right away because it knew the image height and width. Really, any template that uses the coverImageURL would benefit.

Thanks!

Re: Additional export options/keys

Posted: Tue Dec 15, 2009 11:44 am
by marumari
Ooo, ooo, I think I'd also like to see something like this:

Code: Select all

<meta name="templateDescription" content="[string]" />
So that the template can describe how it's laid out or what its features are. I think this would be useful, in addition to the big blob of fields that you get upon export.

Re: Additional export options/keys

Posted: Fri Dec 18, 2009 10:59 am
by Conor
Ooo, ooo, I think I'd also like to see something like this: <meta name="templateDescription" content="[string]" />
You can append more information to the automatically created description with:

Code: Select all

<meta name="credits" content="[string]" />
I have also implemented your two other suggestions in the Gamepedia beta. Those will make it to the other Pedia betas soon.

For the date the key is:

Code: Select all

<meta name="date-format" content="[unicode-format]" />
An example would be:

Code: Select all

<meta name="date-format" content="YYYY-MM-dd" />
The information on how to build the format string for the dates can be found at the unicode format web page.

The new height and width keys are the ones you suggested:

Code: Select all

[key:coverImageURLHeight]
[key:coverImageURLWidth]

Re: Additional export options/keys

Posted: Fri Dec 18, 2009 11:32 am
by marumari
The credits thing seems to be working great, although the field where it displays the description will get off if it gets too long. Otherwise, looks good.

The code I used for the height/width was this:

Code: Select all

<img src="[key:coverImageURL]" id="cbcoverimg" alt="[key:title] Image Cover" <!--IFcoverImageURLHeightheight="[key:coverImageURLHeight]"--ENDcoverImageURLHeight--> <!--IFcoverImageURLWidthwidth="[key:coverImageURLWidth]"--ENDcoverImageURLWidth--> />
But all it produced was this:

Code: Select all

<img src="Images/101.jpg" id="cbcoverimg" alt="Advance Wars Image Cover" />
I guess I could just use only <!--IFcoverImageURL (since the other two don't matter if it isn't there), but the values for coverImageURLHeight and coverImageURLWidth are still blank with the version I have (beta 2).

We're really getting close, and I appreciate all your hard work. When this is ready, FancyIndex should popup very quickly, and even have scrollbars if its size exceeds the viewport and everything. Going to be great. Thanks!

Re: Additional export options/keys

Posted: Fri Dec 18, 2009 11:39 am
by Conor
No "<!--IFcoverImageURLHeight" available. As I mentioned in the email because it's a different function that handles the images it's not as advanced as the regular key replacement. With the new version the key will always exist. On the old version the HTML will be wrong, but I believe all browsers will ignore a non-number value.

Re: Additional export options/keys

Posted: Fri Dec 18, 2009 11:58 am
by marumari
Okay, I removed the IF/END bits, so now it's just this:

Code: Select all

<img src="[key:coverImageURL]" id="cbcoverimg" alt="[key:title] Image Cover" height="[key:coverImageURLHeight]" width="[key:coverImageURLWidth]" />
But I still only get this as a result:

Code: Select all

<img src="Images/101.jpg" id="cbcoverimg" alt="Advance Wars Image Cover" height="" width="" />
With Gamepedia 4.5.4, Beta 2.

Re: Additional export options/keys

Posted: Sat Dec 19, 2009 9:04 am
by Conor
I changed the beta number, to avoid confusion, is is now Gamepedia 4.5.4 Beta 3 (Download the beta as I fixed an unrelated bug with the my rating stars that I introduced). The issue is that your "details" template is asking for the height and width but it was the listing template that exported the images, hence the details templates has no information about the images as it skips them all together. To fix just move the image export to the details template instead of the listing template.

E.i. move the following to the listing template:

Code: Select all

<meta name="image-export" content="no" />
And this from the listing to the details one:

Code: Select all

<meta name="image-export" content="yes" />
<meta name="image-width" content="320" />
<meta name="image-height" content="320" />
<meta name="image-compression" content="0.7" /> <!-- just a guess for "Good" -->
Also the image src should now have "details" at the beginning of the url to reflect the new folder for the covers and should look like this:

Code: Select all

<img src="details/[key:coverImageURL]" id="cbcoverimg" alt="[key:title] Image Cover" height="[key:coverImageURLHeight]" width="[key:coverImageURLWidth]" />
The DVDpedia beta also includes all these changes.

Re: Additional export options/keys

Posted: Sat Dec 19, 2009 10:47 am
by marumari
Awesome! That's working *perfectly*. The colorbox now pops up immediately, and at exactly the right size. :) :) :)

Still got a few more changes to make due to this and I'll get a new version of the template up. Woo!