Jump to content
mr-fan

New project a nice growing "kindergarten"

Recommended Posts

Hi Guys,

done a small kindergarten project that works with care on kids only in the wood and outdoor.

http://waldkindergarten-altfraunhofen.de/

It's my second project with PW and learning so much on every project i'm getting better and better with API, modules, using more special tools.... ;)

like on this one first time:

  • AIOM->greatTool
  • MarkupWeather->worksGreat
  • PageProtector + PageRenameOptions for the building time

and AllTimeLovers:

  • AdminCustomPages
  • ChangeImageSelect
  • MarkupSimpleNavigation
  • PageListBetterLabels
  • TemplateDecorator
  • VersionControl
  • MarkupSitemapXML
  • ModulesManager
  • CropImage
  • Changelog
  • ListerPro

The project is a small budget so i'm relying on a individual changed themeforrest template - no own design this time.

With this one i've made my first experience with URL Segments and i love it like everything else in PW!

Worked out a little "archive" script with 80 line of Code and some URL Segments for the /archiv/ as SEG1 and cat or year as SEG2 should work great. Using the PagerMarkup with Somas Code for SEO friendly links - Thanks for this one.

At least thank you all and especially Ryan for making such little happy things possible!

post-2327-0-70544600-1427330786_thumb.jp

  • Like 9

Share this post


Link to post
Share on other sites

Just forgot - i'll always wanna share the interesting parts to this forum so may others can learn something or i can improve something...

i use in my template the delegate approach with a

_init.php and a

_main.php

for the whole HTML Part....but i've read from Horst about a great and simple solution to split up easy HTML parts for special contents and templates...with this simple lines of code:

_init.php

$myLayout 	= "default"; 	//default layout

_main.php

<?php include_once("./layouts/_{$myLayout}.php");?>

So i could use twocol layout if needed mabe if i've subpages:

// If the page has children, then render navigation to them under the body.
// and get the sidebar
$level = count($page->parents);
if ($page->template != "start") {
	if($page->hasChildren || $page->siblings && $level == 2) {
		$myLayout = "twocol";
		$sidebar = "<p>".$page->meta_description."</p>";
	}
}

or get some more logic together with URL Segments on the mentioned archive page:

<?php
// aktiv-root.php template file
// overview - all activities from the kids
//I've /aktuelles/archiv/2014/ or /aktuelles/archiv/kochen/
//segment1 = archiv  ->show the archiv
//segment2 = jahr 	->show the posts from choosen year
//segment2 = kochen	->show the posts from choosen cat

//get all segments for choosing the output/layout!
$seg1 = $sanitizer->pageName($input->urlSegment1);
$seg2 = $sanitizer->pageName($input->urlSegment2);
$seg3 = $sanitizer->pageName($input->urlSegment3);
//get the rootpage of the posts
$aktivroot = $pages->get(1063);
//Load normal akitv_root Layout with isotope view of the last 12 entries!
if (!$seg1) {
	$myLayout = "aktiv_root";
	$headinfo .= "<h5><a href='{$aktivroot->url}archiv/#start' alt='Archiv'>Alle Einträge im Archiv</a></h5>";
}
//check if we are in /archiv/ first!
if ($seg1 && $seg1 != 'archiv') {
	// unknown URL segment, send a 404
	throw new Wire404Exception();
}
//check for the third urlsegment not needed
if ($seg3) {
	// unknown URL segment, send a 404
	throw new Wire404Exception();
}
//get startet to separate the posts in years and categories
if($seg1 == 'archiv') {
	//Load categorie akitv_archiv Layout show all or divided by category or year!!
	$pageNum = $input->get->page ? $input->get->page - 1 : 0;
	$limit = 5;
	$start = $pageNum * $limit;
	$posts = $pages->find("template=aktiv,start=$start,limit=$limit,sort=aktiv_date");
	$myLayout = "aktiv_archiv";
	$headinfo .= "<h2>Alle Einträge im Archiv</h2>";
	if ($seg2){
		if(preg_match('/^(\d{4})$/', $seg2, $matches)) { //Load year View if $seg2 wrong 404
			// A URL segment matched in the format of year-month, i.e. /news/2010-12
			$year = $matches[1];
			$startYear = strtotime("$year-01-01");
			$endYear = strtotime("$year-12-01");
			$now = time();
			//Load dates aktiv_archiv Layput show all posts for a selected year
			$posts = $aktivroot->children("aktiv_date>=$startYear, aktiv_date<$endYear");
			$headinfo  = "";
			$headinfo .= "<h2>Alles aus dem Jahr ". $seg2 ."</h2>";
			if ($posts == ""){
				// not valid category, send a 404
				throw new Wire404Exception();
			}
		} else { //Load cat View if $seg2 wrong 404
			//get all categories
			$cat = $pages->get(1077)->children("include=all");
			//search for the given urlsegment3 as the category
			$catsearch = $pages->get("/site/aktivitaeten-typen/{$seg2}/");
			$found = $cat->filter("id={$catsearch->id}");
				if ($found == ""){
					// not valid category, send a 404
					throw new Wire404Exception();
				}
			// valid category, list items in it
			// Load categorie akitv_archiv Layout with listing of all entries of one category
			$posts = $pages->find("template=aktiv,limit=2,aktivcat={$found},sort=aktiv_date");
			$headinfo  = "";
			if (count($posts)) {
				$headinfo .= "<h2>Alles zum Thema ". $catsearch->title ."</h2>";
			} else {
				$headinfo .= "<h2>Leider keine Artikel zum Thema ". $catsearch->title ." vorhanden!</h2>";
			}
		} //end cat or year view = seg2
	} //end /archiv/ = seg1
} //end output

(may someone find some mistakes i'm not a PHP proffesional - and always open for refactoring.... ;) )

Best regards mr-fan

  • Like 4

Share this post


Link to post
Share on other sites

Thanks folks for the 300 likes....:-)

  • Like 2

Share this post


Link to post
Share on other sites

Now you have two more :)

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By angelo, italy
      Hi guys,
      I've always used WP but I want to swtich to PW. I'm not sure ....
      I'd like to know if it's possible to create a website for an online photo contest.
      The participants of the competition could create their own account, in which they upload their photos. The photos uploaded remain visible only to themselves and the judges.
      From their account they can make the "entrance fee" payment.
      The judges of the competition can create their own account... entering they see the photos of the participants and vote photos
      At the main page I imagine the title of the competition, a button to read the regulation, and a button to register.
      The website should be in Italian and English.
      Thank you!!
       
       
    • By schwarzdesign
      We recently finished a relaunch of  the website of the consulting firm Engfer Consulting: engfer-consulting.de. Built with ProcessWire 3 and Bootstrap 4.
      Features
      Bilingual website (UPDATE: The English page is now available! the English page is inactive at the moment, as the content is not ready yet) A strong, simple data structure for job offers and news, allowing for a custom search page and fulltext search Sectioned content-blocks built with a Repeater Matrix (ProFields) Reusable components available as page reference fields Automatic generation of open graph-tags, with manual overrides available on each page Contact forms with a custom recipient depending on the current page Modules used:
      ProFields ProForms Sitemap Cookie Management Banner Duplicator Tracy Debugger Wire Mail SMTP Admin Links in FrontEnd Technical insights
      Most of the content is built using a Repeater Matrix field. Each section has an optional heading and a select-field for background colors. Some of the sections available include:
      Text blocks (a repeater-field for multi-column text) Feeds / listing of the latest job offers or news (with a field to control the number of entries shown) Displaying a team member or quote (selected through a page reference field) Downloadable files (a multivalue field for file uploads) Those sections can be combined and stringed together arbitrarily, so any number of page templates showing different contents can be built. The job offers template, in contrast, features fixed fields for taxonomy assignment, description, contact person, preview image and so on, making the job offer pages uniform and easily accesible.
      The (technically) most interesting part of the site is the job overview page, which contains custom filters that are automatically generated from the available taxonomy terms.
      The stylesheets are written in SASS, built with Bootstrap 4. Only the base and grid SASS files of Bootstrap are included, along with the Bootstrap components that we ended up using. Using Bootstrap 4 as a framework in this way makes development & styling blazingly fast, once all the utility classes are commited to muscle memory ...
      > Our Agency.
      Screenshots









    • By benbyf
      Not new, but a website I've worked on for a year or so in continous development.
      http://supercarownerscircle.com/
      I originally inherited the site from another web design company - upgraded PW and over the year added ecommerce using the Stripe module and a custom integration, revamped the frontend and added lots of new templates.
      Also did some frontend work on the shopify shop.

       
       
    • By henri
      Hi Guys, 
      I am new to processwire. I have to move a proceswire web to another server. How do i do that??? copying all the files doesnt seem to do the trick. I am presented with a very very old version of the website. What do I do wrong??
    • By Sabrina
      Hi,  
      I would like to start tracking my website visitors with Leady software. Searched the forum for similar discussion yet did not find the right answer. Could you please tell me how can I add their javascript to my website? Is there any step by step guide available?
      Any help appreciated. 
×
×
  • Create New...