bwanders / dokuwiki-strata

Strata - a Semi-Structured Data plugin for Dokuwiki
https://www.dokuwiki.org/plugin:strata
17 stars 8 forks source link

link style and image sizes #38

Closed dhighet closed 7 years ago

dhighet commented 7 years ago

http://han.dekthro.com/gear/weapon

Is there a way to have the links styled as "Title_Key" (which I have set as "Name") so as to not have lowercase_underscored_links? Also I have a variety of long/wide images being used, so doing something as [image::16] works really inconsistently, any suggestions as a solution to this? Thank you!

bwanders commented 7 years ago

There certainly is a way to have your links and images styled better!

Strata actually uses DokuWiki's configured heading setting for that called "Use first heading for pagenames" (the useheading option), which can be found on your dokuwiki's configuration page. If you switch that to Always, not only will Strata links be nicer, but the links in your breadcrumbs (i.e., the "You are here" part of the page) will also use the page headings instead of lowercase_underscored_links.

The image scaling can be forced to 16 for both dimensions: [image::16x16] will force both width and height to 16. This will make sure that the staffs and canes show up in a 16 by 16 icon.

Let me know how it turns out!

dhighet commented 7 years ago

Awesome! Looks much better. I tried setting the [image::16x16] though it doesn't seem to be changing the sizes. for the taller images.

bwanders commented 7 years ago

What happens is that Strata does not actually store the type and hint with the value. So if you want the images to be sized in the table, you'll have to put the image hint in the table:

<table ?item ?graphic[image::16x16] "" ?dur. ?sdmg ?ldmg ?dmg ?hit ?vita ?mana ?M ?G ?W ?Lvl ?acquisition>

Note the [image::16x16] type directly on the table, that should do the trick.

dhighet commented 7 years ago

Still no dice :( it seems to be checking width just fine but stops before height?

bwanders commented 7 years ago

After some looking around, I am reasonably sure that the lack of image scaling is not a Strata issue. Strata actually defers to dokuwiki's image handling for the rendering of any [image] typed fields.

It appears as if your dokuwiki (or webserver) is not correctly handling requested image scaling. The image has the corrected width and height attributes in the generated HTML, and the image url (e.g. http://han.dekthro.com/_media/gear/weapon/wardens-cane.png?w=16&h=16&cache=&tok=269ff6) includes the necessary w and h query parameters.

However, the image file that is served is not scaled at all. I can't say with 100% certainty what the problem is, but I would suggest having a good look at Apache's Rewrite Rules you have configured, it might be that the query string is not correctly passed through to dokuwiki.

dhighet commented 7 years ago

Awesome, thanks for the insight into it beyond your plugin. I'll take a look at my webserver settings and see if there is something I can find.

bwanders commented 7 years ago

(Since no new information has been brought forward on whether the issues was related to Strata, I'm closing this issue until further information comes to light)