Recently Browsing 0 members
No registered users viewing this page.
lets say, in _main.php I have some placeholder regions for content/sidebar
<div id="content">foo</div> <div id="sidebar">bar</div> in my home.php template, maybe i don't want the sidebar div at all. But when I put in the intentionally blank code
<region id="sidebar"></region> I simply make my sidebar div blank, it doesn't remove it.
Q: Is there a slick way to simply nuke that div#sidebar entirely from markup?
I as have been a bit confused for some time about how the "Markup Regions" functionality in Processwire worked.
But i have know read a bit more and think that i am getting to grips with it. And Markup Regions is going to be huge.
To aid me in understanding Markup Regions better i started to read the Source code for the new "Regular" theme in conjunction with the Blog about the markup regions.
It helped me a great deal to understand the basics and more fine details of it.
A tip is to open both links and use the Source code of the "Regular" theme while reading the blog post.
The Source code:
The Blog post:
I hope this could help others starting out with markup regions.
Just take it slow and read it a couple a times and soon you will see the greatness of markup regions.
By Mike Rockett
Docs & Download: rockettpw/markup-sitemap
Modules Directory: MarkupSitemap
MarkupSitemap is essentially an upgrade to MarkupSitemapXML by Pete. It adds multi-language support using the built-in LanguageSupportPageNames. Where multi-language pages are available, they are added to the sitemap by means of an alternate link in that page's <url>. Support for listing images in the sitemap on a page-by-page basis and using a sitemap stylesheet are also added.
Example when using the built-in multi-language profile:
<url> <loc>http://domain.local/about/</loc> <lastmod>2017-08-27T16:16:32+02:00</lastmod> <xhtml:link rel="alternate" hreflang="en" href="http://domain.local/en/about/"/> <xhtml:link rel="alternate" hreflang="de" href="http://domain.local/de/uber/"/> <xhtml:link rel="alternate" hreflang="fi" href="http://domain.local/fi/tietoja/"/> </url> It also uses a locally maintained fork of a sitemap package by Matthew Davies that assists in automating the process.
The doesn't use the same sitemap_ignore field available in MarkupSitemapXML. Rather, it renders sitemap options fields in a Page's Settings tab. One of the fields is for excluding a Page from the sitemap, and another is for excluding its children. You can assign which templates get these config fields in the module's configuration (much like you would with MarkupSEO).
Note that the two exclusion options are mutually exclusive at this point as there may be cases where you don't want to show a parent page, but only its children. Whilst unorthodox, I'm leaving the flexibility there. (The home page cannot be excluded from the sitemap, so the applicable exclusion fields won't be available there.)
As of December 2017, you can also exclude templates from sitemap access altogether, whilst retaining their settings if previously configured.
Sitemap also allows you to include images for each page at the template level, and you can disable image output at the page level.
The module allows you to set the priority on a per-page basis (it's optional and will not be included if not set).
Lastly, a stylesheet option has also been added. You can use the default one (enabled by default), or set your own.
Note that if the module is uninstalled, any saved data on a per-page basis is removed. The same thing happens for a specific page when it is deleted after having been trashed.
Yesterday I found out about the relatively new markup regions functionality and I love it. The ease of use and simplicity is just what I think is typically ProcessWire and is why Im still happy I chose for PW four years ago when changing CMS/CMF. So thanks Ryan for your vision and all you put into it.
That said, Im running into an issue I'm not sure what to think of it.
I have enabled markup regions in config.php and it does what I suppose it should: it replaced and all. Very neatly.
The only thing I discovered is that while Im debugging some issues and I use var_dump to echo some stuff, it does that two times in a row. And this only happens when useMarkupRegions is enabled.
I dont get this, does it mean the template file gets called twice (and thus the script is run twice?) or is it only displayed twice, where the first time most output is erased and /or replaced by the substituted output?
I don't really get whats going on there. Is this behavior normal when using markup regions?
Hi all, I am new to PW and building up a website for a customer and have some problems with structuring my project:
On my main.php file I have a main-tag where I wan't to echo the region called 'content'. But the problem is that the markup inside this wrapper should be variable.Example: I have a page where all the news previews are outputed like in a normal news app--> no additional markup is needed. But on "home" I want to have different sections with content -->
<section> <div class="slider"> <!--here i want to have some filtered news articles--> </div> </section> <section> <div class="news"> <!--here i want to have some news articles but with another filter--> </div> </section>
How can I realise that? It has to be like that for responsive purposes.
Is it maybe possible to create and echo regions inside the "parent region"?
Cheers and thank you for your help