New GregCustom Theme

User avatar
NorfolkGreg
Posts: 114
Joined: Wed Sep 01, 2021 7:50 am

Re: New GregCustom Theme

Post by NorfolkGreg »

I've produced an update for the theme, to replace v0.0.5 and as it's now included in the formal package,I've made the new release v1.0.0

Hopefully, it will become available to all when the daily Wcms update check runs.

I've tweaked some of the additional colour schemes referenced in the ReadMe.txt file found in the "resources" folder. There's also added colour variables for a new feature included in this update. There's now CSS code that allows the user to create "cards", areas where the contents is shown in rounded corner boxes like this:
screenshot-418.png
screenshot-418.png (170.04 KiB) Viewed 859 times
Perhaps I should have said earlier that this theme is intended for users with enough HTML knowledge to be able to use the default editor (not Summernote) to wrap their content in the appropriate tags.

To achieve the result above, you need to add a "section" of class "cards". Each card is then added to that section within "article" tags. Any image within the card will be floated left.

As you may guess the code was added with a particular use in mind, but I hope is adaptable enough for other's use. The images used here within the h3 tags will be displayed at 200x150px and will be floated left. The code is as shown:

Code: Select all

	<section class="cards">
	<article>
		<h3><a href="blockade">
		<img src="/data/files/t-blockade.jpg" alt="Blockade - Box, Board and Components">
		Blockade</a></h3>

		<p>2 Players - 8-99 Years - (15min)</p>
		<p>I reviewed this game in the Peterborough Standard in 1982. The aim
			is simple. Get one of your pieces to occupy one of your opponent's
			starting points. The trick is in using the two square long barrier
			pieces both to frustrate your opponent and defend your route to
			their starting points. It's a game I still enjoy playing but my
			wife does not. She doesn't like games where you need to think about
			and plan a few moves ahead.</p>
	</article>

	<article>
		<h3><a href="gameofnations">
		<img src="/data/files/t-gameofnations.jpg" alt="Game of Nations Components">
		The Game of Nations</a></h3>

		<p>2-4 Players - 12-99 Years - (90min)</p>
		<p>This game was published by Waddingtons in 1973 along with a revised
		"Mine A Million" renamed "The Business Game". Both were aimed at adults
		and older children. The Game of Nation's box proclaimed it as "A
		political strategy game. For two to Four players". While role-playing
		games were appearing on the market, this was the first for Waddington
		in having no clearly defined aim, beyond surviving.</p>
	</article>

	</section>
I've just realised that I haven't included this explanation of the use of this added code within the ReadMe.txt file. I'll do that with the next update when I'll also edit the README.md to indicate the intended audience for the them.

You can see it in use at: https://gregchapman.uk
User avatar
nox
Posts: 55
Joined: Sat May 23, 2020 9:02 pm

Re: New GregCustom Theme

Post by nox »

Hey NorfolkGreg,

great theme, I'm glad it's added to WonderCMS themes.

There are two small issues:
1. missing headerwide.jpg image inside /images
maybe just add a description inside a Readme file that users can upload a custom image with the same name to show on the home page

2. Simple blog plugin
Blog plugin is using page('title') and page('description') for its own thing and duplicates everything if used in the theme.
Adding blog.php with modified header (where title and description is removed or replaced with 'Blog' text) does fix the issue on blog page, but it is still a problem on blog posts.

Tried working on this because I will probably use it someday, following this solution:
viewtopic.php?t=3587

And this is the working result where header is replaced with following code (wish someone would review it):

Code: Select all

<header>
	<?php
		// get current $dir
		$dir = pathinfo($Wcms->getCurrentPageUrl(), PATHINFO_DIRNAME);
		$pattern = '/blog/';

		// if Blog Post, remove title and description, add text Blog below site title
		if (preg_match($pattern, $dir)) {
			echo 
				'<h1>',
					'<em>', $Wcms->get('config', 'siteTitle'), '</em>', '<br>',
					'Blog',
				'</h1>';
		// if Blog Page, remove title and description, add text Blog below site title
		} elseif ($Wcms->currentPage == 'blog') {
			echo 
				'<h1>',
					'<em>', $Wcms->get('config', 'siteTitle'), '</em>', '<br>',
					'Blog',
				'</h1>';
		// Default Page
		} else {
			echo 
				'<h1>',
					'<em>', $Wcms->get('config', 'siteTitle'), '</em>', '<br>',
					$Wcms->page('title'),
				'</h1>',
				'<h2>', $Wcms->page('description'), '</h2>';
		}
	?>
</header>
User avatar
NorfolkGreg
Posts: 114
Joined: Wed Sep 01, 2021 7:50 am

Re: New GregCustom Theme

Post by NorfolkGreg »

Thanks for the feedback, Nox
nox wrote: Tue Nov 19, 2024 10:54 am There are two small issues:
1. missing headerwide.jpg image inside /images
maybe just add a description inside a Readme file that users can upload a custom image with the same name to show on the home page
Ah! I'm not clear what the protocol on this is. I guess I expect users to check out the README.md file. That tells you that here are a couple of header images in the "resources" folder where you'll find a ReadMe.txt file which has lots of info on customising the theme.
2. Simple blog plugin
Blog plugin is using page('title') and page('description') for its own thing and duplicates everything if used in the theme.
You have me there! I haven't checked out the theme with any plug-ins, mainly because I don't use any myself - not even Summernote! I shall certainly try to check them out and note any that don't work in the README.md.

Let me try to absorb and understand the rest of your note. My problem is that I know nothing of PHP (beyond using includes in my manually coded web pages).
User avatar
NorfolkGreg
Posts: 114
Joined: Wed Sep 01, 2021 7:50 am

Re: New GregCustom Theme

Post by NorfolkGreg »

Just had a quick scan of viewtopic.php?t=3587
The technicalities are all a bit beyond me. All I can do to help is by volunteering to test things.

I don't know whether I should say that I remember trying out the Blog plug-in when I first encountered Wcms. I wasn't impressed, feeling that if you wanted a blog then there were better more powerful tools around and I didn't see how it could be useful as an add-on to the kind of site I expected to build with Wcms. But I'm not against trying to help make it work with the GregCustom theme.
User avatar
nox
Posts: 55
Joined: Sat May 23, 2020 9:02 pm

Re: New GregCustom Theme

Post by nox »

Hey Norfolk Greg,

my apologies for the first one about header picture, it is indeed described in the readme file. I did go through it before but somehow missed that part :)

Blog plugin is alright for small updates and news, nothing fancy. But it is also a pain to work with using custom WonderCMS shortcodes ($Wcms) and overwriting default blog styling.

Theme works with Summernote Editor without any issues.

As you said, WonderCMS without plugins is the way to go.
User avatar
NorfolkGreg
Posts: 114
Joined: Wed Sep 01, 2021 7:50 am

Re: New GregCustom Theme

Post by NorfolkGreg »

I've just updated the documentation file "README.md" and the additional information in the "ReadMe.txt" file found in the resources folder.

Hopefully, I've arranged the material a little better and it will encourage people to examine the content of the "resources" folder before doing too much work on their site.

I have not done anything to increment the version number, but as I understand it, those installing the theme from now on will see and download the replacement files, while those who already have v1.0.0 installed will need to download them manually from Github.
Post Reply