ryan

Small Project Walkthrough (Planets)

Recommended Posts

Ryan

I was just thinking that it would be great if this was carried on in some way. I think the main advantage of having a whole site tutorial is that so many different methods come up that we all face in our projects:

How you organise your templates

How you go about changing permissions so that the end-user only edits what is needed

Field types

Navigation

I think when it's all part of a project then it's easier to grasp and people will come out the other end of it with a much better idea on how to do their own projects.

I know time must be very short and if there's any way I can help out, I'd be delighted.

I also must stress that on a general level, the documentation here is outstanding, I just think an all-inclusive project walkthrough would be the icing ;)

  • Like 2

Share this post


Link to post
Share on other sites

ProcessWire is meant to support your existing way of developing things, but I think it's always good to provide a starting path and then let people take it from there. More needs to be added, like you mentioned. We added the tutorials board here a few months ago and hoping to continue adding to it with more stuff like this. I also want to start adding new site profiles. I plan to expand on this tutorial with the items mentioned at the bottom of it (page 1), as soon as time allows. Anyone that wants to make tutorials or site profiles, that's great too and just let me know what I can do to assist.

  • Like 1

Share this post


Link to post
Share on other sites

I'd love to help out but think it's pretty early days for me so far!

I feel that it may actually be the 'back-end' where most of the head-scratching goes on (that could just be me though).

We're lucky that the community and yourself back this product so much that the answers are nearly always out there.

Share this post


Link to post
Share on other sites

We're lucky that the community and yourself back this product so much that the answers are nearly always out there.

I think it's quite telling that there isn't a tag for PW on Stack Overflow. :lol:

  • Like 3

Share this post


Link to post
Share on other sites

This is my first post on PW forum. I'd like to say Hi to everyone and express my thanks to Ryan and Crew for givining us this amazing tool. I've been looking for CMS of such kind for some time now without satisfactory results but after discovering PW few days ago I'm content. Thanks again!

Oh, and I'm looking forward to see some new tutorials :)

Cheers!

  • Like 3

Share this post


Link to post
Share on other sites

Hi mike77, nice to see another first-time poster on the forum. What topics would you like to see new tutorials cover?

Share this post


Link to post
Share on other sites

As a matter of fact I'm developing a project for a client and when I found PW I decided to switch to it - that means I must start some work from the beginning (but I'm sure it's worth the time for future benefits). The basic PW knowledge I found on PW website and forum is what I need right now so I don't have any suggestions about new tutorials at the moment. Questions may appear along the way though.

Thanks for asking anyway. Regards.

Share this post


Link to post
Share on other sites

Basic question: is it possible to add couple of times the same field (literally the same, not the same type) to one template?

In admin panel there is no option to do so.

Share this post


Link to post
Share on other sites

If I understand you correctly is this possible using a repeater. Check out the video and if you have any questions please report back!

Share this post


Link to post
Share on other sites

Thanks for directions. I must spend more time reading API - I just read the basics and it seems I should move on with it.

Share this post


Link to post
Share on other sites

You're welcome. I read most anything in the API and watched most video's. Also check out the cheatsheat. It's made by soma and is very handy when you quickly need to find something.

  • Like 2

Share this post


Link to post
Share on other sites

One more basic question about Repeater...

I have this code which is working fine for a single text field (called "medic").

<form>
<?php
 $choice = $pages->find('template=clinics');

 foreach($choice as $ch)		
 echo "<label>$ch->title</label>	
 <select>
	 <option></option>
	 <option>$ch->medic</option>
 </select>";		
?>
</form>

Now I need to put the single field into the Repeater (to be able to add some more in future) called for example "med" and I have a problem doing so. It seemed easy but I tried few options and they didn't work. The obiouse was to change

<option>$ch->medic</option>

to

<option>$ch->med->medic</option>

but it doen't work of course. How to use the existing loop to manage the output of Repeater fileds? Should I add one more loop inside the existing one just for the Repeater?

Share this post


Link to post
Share on other sites

If med is a repeater field you would also have to loop it, same as with looping a page array. Hope that helps. Am on mobile...

Share this post


Link to post
Share on other sites

It is a repater indeed and I know that I need to use a loop to render the output. The problem is that I have already one loop in the code (it outputs the form markup). I tried to put another one especially for the repeater (as sibling to the existing loop or as a child of it) but it doesn't make sens. I also put the repeater loop in function and then called it from inside the original loop with no results.

It's simple issue but confusing for me.

Anyone?

Should I start a new forum topic?

Share this post


Link to post
Share on other sites

You have to put it inside, not as a sibling.

<form>
<?php
$choice = $pages->find('template=clinics');

foreach($choice as $ch){	
   echo "<label>{$ch->title}</label>		
   <select>
       <option></option>";
       foreach($ch->med as $med) echo "<option>{$med->medic}</option>";
       echo "</select>";
   }	
?>
</form>

Share this post


Link to post
Share on other sites

I think it's better to start a new topic, as it doesn't belong here.

Also, I think I'm more confused than you, as I don't understand what you want and what exactly your setup is. So please try to give all the infos needed. Maybe a screen of you edit page screen and your code will help understand.

Thanks

Share this post


Link to post
Share on other sites

<form>
<?php
    $choice = $pages->find('template=clinics');

    foreach($choice as $ch) {
        echo "<label>$ch->title</label>";
        echo "<select>";
           echo "<option></option>";
           foreach ($ch->med as $med) {
            // $med will have your single repeater, so something like this:
            echo "<option>$med->medic</option>"; // or $med->title or whatever fields your repeater has
           }
        echo "</select>";
    }    
?>
</form>

Share this post


Link to post
Share on other sites

Thanks guys - and sorry Soma if I wasn't more specific - it works of course and I tried to did it this way. I must have made simple mistake and then I assumed I made wrong approche.

Sorry for the off-topic as well.

Share this post


Link to post
Share on other sites
I could have sworn there was another part to this tutorial that included images?!

not yet I don't think, but that's a good idea! :)

  • Like 1

Share this post


Link to post
Share on other sites

Hello,

I just finished the Planet tutorial for beginners, but could not use the title field page->title just for title tag in header, the h1 is blank, why? Thanks, Andreas (my pw: 2.3)

Share this post


Link to post
Share on other sites

Welcome to the forum asosking. Can you post the piece of code that is giving you trouble? Since your question is so vague, we can't even know how much PHP you know, so I will assume it's not much. Can you tell us the result of doing this instead of page->title, to see if your php is working?

<h1><?php echo "php is working" ?></h1>

Share this post


Link to post
Share on other sites

Hi diogo, I just copy+paste the php code from the tutorial. In head is working, but not in h1. Thanks

Share this post


Link to post
Share on other sites

Hi aso, can you post the code you are using in here? Chances are it's a very simple character out of place.

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.