ComboStrap / combo

Dokuwiki Combo Plugin. Making Web Publication a Breeze
https://combostrap.com
GNU General Public License v2.0
13 stars 4 forks source link

data-page-id CSS selectors #86

Closed vaniwiki closed 2 months ago

vaniwiki commented 2 months ago

Not sure how to sell this feature, but I used to put this code into my <body> tag: data-page-id="<?php echo $ID ?>, which makes it possible to style one's website according to section, targeting a specific namespace or page.

For more info, see this forum thread.

gerardnico commented 2 months ago

This is already in it. If you inspect any link you get a data-wiki-id:

<a data-wiki-id="howto:getting_started:1_dokuwiki">How to install Dokuwiki ?</a>
vaniwiki commented 2 months ago

I don't mean links, sorry for being unclear in my explanation. I want to style all pages inside a certain namespace.

In one example, I want the namespace "letters" to show me all text in a monospaced font (to make it feel like a typewrited page). So I would add this selector to my css: body[data-page-id^="letters:"] and style it.

In another hypothetical example, I could style pages starting with "blog:2024:01:" (for January) with a snowy background.

I'm sure I can give other practical examples as well. I've used it to style certain books in a certain way, or make blockquotes in one section look different from another section.

gerardnico commented 2 months ago

On a design level, one domain, one design is the recommendation.

As of today, you can apply a template to one namespace. https://combostrap.com/theme/what-is-a-template-z9tl87hg

gerardnico commented 2 months ago

The explanation is here: https://combostrap.com/howto/how-to-create-your-own-theme-m092ki81#how_to_apply_a_template_for_a_whole_namespace

vaniwiki commented 2 months ago

I have been going through the ComboStrap directories now to figure out how I can just paste my code into the body tag. But that did not work as expected. What was previously simple (in Bootie, just edit main.php, if I'm not mistaken), now it requires to make themes per each...

If one reason why people want to apply a template to a namespace is that they want to style it differently, wouldn't it make much more sense to just include a tiny data-page-id snippet into the body tag? But let's say that I want to do this myself, how do I go about to add this php snippet in the .hbs file?

gerardnico commented 2 months ago

All road goes to Rome ;) It would need to change all templates. As of today, I don’t have this time.

The explanations on how to create a proper template are in the previous link.

ie https://combostrap.com/howto/how-to-create-your-own-theme-m092ki81