-
-
Notifications
You must be signed in to change notification settings - Fork 266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal to allow some static pages to be "wide" #717
Comments
For this purposes it better to use the custom config features actually (admin/config/custom). The custom config still persist even we update the htmly. Edit: and for specific purposes eg, want a custom functions (for subscriptions etc.) use the theme |
Hi Dan... Are you sure you mean to use custom config for #717 rather than #716? For #717, the config file would need to have a table of all pages requiring the special property, so it may be better to store the property with the page itself, at the time the page is created. Can the special comments at the start of each page be used for that purpose... i.e. |
The simplest is adding <?php
function is_wide ($string)
{
$wide = explode('<!--wide-->', $string);
if (isset($wide['1'])) {
return true;
} else {
return false;
}
} In your static template file you can call the functions: <?php if (is_wide($p->body)):?>
<div class="entry-content this-is-wide">
<?php echo $p->body; ?>
</div>
<?php endif;?>
<?php if (!is_wide($p->body)):?>
<div class="entry-content this-not-wide">
<?php echo $p->body; ?>
</div>
<?php endif;?> That's just an idea, you can improve it to meet what you need. Edit: or use |
Thanks. I'll play with this for a bit on my site and do a PR when it's ready. |
Well no need to add it to the core actually, a better docs is sufficient. With functions.php for theme is enough to allow similar mod. |
Aren't the admin screens part of the core? |
Is this theme specific setting? I mean existing theme will change also? if not than there are around 18 themes need to be updated (css, html etc.). We should not add certain settings to the config page (not the custom one) if those settings only affect specific theme. Example Cleanblog theme or Casper theme (dark setting), the setting for those theme not added to the core settings. Edit: We need to keep the main settings as simple as possible, and use custom settings or functions.php for the rest. |
Ah! I understand now. I thought this could be a new standard setting, supported by the Admin code. But of course, it can't be unless every theme supports it. In that case, I'll keep all the code inside my theme and you can close this. BTW, this year is my 50th year working in software development, but I haven't used PHP since about 2005. So thanks for helping me get on track. |
Glad you agree too. Yes we should be as simple as possible with this. @CharliePoole 50 years and still being active in your field is an achievement in itself, kudos for that. As long as we understand a little about PHP, HTMLy can be said pretty flexible. You're welcome 😃 |
By "wide" I mean joining the two columns into one wider column.
I have modified HTMLy locally to do this for all static pages and it works technically, but it doesn't suit me because I only want certain limited pages to be wide. Obviously, I could do this by creating a page-specific layout, but I think a page setting of
wide = true/false might be cleaner.
Would you accept a PR to do this? It would be a nice way for me to get started contributing. If it is out of scope for HTMLy and you prefer all non-custom layouts to be 2-column, then I'll use a custom layout file where I need it.
The text was updated successfully, but these errors were encountered: