-
Posts
4,296 -
Joined
-
Last visited
-
Days Won
79
Everything posted by diogo
-
[New project] All kinds of relations between pages
diogo replied to arjen's topic in Getting Started
Arjen, It will be very easy to achieve that structure with pages in processwire, alsothe ones that are not visible in the navigation, because you can choose this on templates, or per page. You can also link the pages very easily using the page fieldType http://processwire.c...page-fieldtype/ Funny, this is the second time I link to this in the forums this week... edit: sorry Marc, I just suggested the same thing as you... edit2: Depending on what you want to achieve, you can make the selection smaller with custom code, showing for instance only the most recent pages under one parent. -
They should stay just for future reference
-
Only reading your later description i was sure that's what you needed
-
You can also put all the widgets under a 'widgets' parent page, and then choose the ones you want for each page with the page fieldtype http://processwire.c...page-fieldtype/ like this they will be separated from the children of each page, and you can use the same in several pages edit: Great news Ryan
-
Maybe you can adapt the technique that Ryan suggestes here for youtube videos http://processwire.com/talk/topic/860-videos-inside-processwire-how-to-embed-videos-inside-processwire/page__p__7271__hl__video__fromsearch__1#entry7271
-
Check this previous post. It should help http://processwire.c...g-from-tinymce/
-
they are
- 14 replies
-
- root
- sub folder
-
(and 1 more)
Tagged with:
-
You only have to move all the folders and files from inside 'pwire' to the root. Make sure you move also the hidden .htaccess
- 14 replies
-
- 1
-
- root
- sub folder
-
(and 1 more)
Tagged with:
-
You can also do the contrary, if you want to change the homepage last, keep the index.html, and the server will get it instead of index.php. From there you can change the links one by one has you move the pages.
-
Looks very nice!
-
works perfectly Nico! edit: although it tells me that all files are 0MB. Should be measured in KB maybe
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
Alex, have a look at this book. I like the way it's structured http://www.amazon.com/PHP-MySQL-Web-Development-4th/dp/0672329166- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
I assumed it would work by doing this. But it should be working by default...
-
@raydale I didn't use the module yet, but i would say that you have to look for that page in the tree, and edit it to assign to it the module process.
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
Same as me Forget the dummies book, apparently it has some typos. I chose to tell you about that one because it focuses on the sintax and on how to write PHP, while others go into SQL queries and reading files for example, and PW already takes cares of those for you.- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
Slightly off topic, Why don't you load jQuery from a CDN like they recommend on the Fancybox website? Loading times should be better because tat copy of jQuery may be already cached on the user browser.
-
-
Ryan, did you consider MarkitUp as an option for imputfield type when using markdown or textile formatters? http://markitup.jaysalvat.com/
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
In the way your code is written, if you put a for each statement between date and body, you have to finish the echo statement with a colon, and start another echo after. To keep the same logic has you have, can go like this: foreach($posts as $post) { echo " <li><a href='{$post->url}'>{$post->title}</a> <p><strong>Date:</strong> {$post->date}</p> "; foreach($post->image as $image) { //code for the images here } echo " {$post->body} </li> "; } Your code is very confusing because of all those copy/pastes. Maybe you could look at each block and choose your favorite way of writing the code. Than you can apply that logic to all the code. For instance, the same code as above, can be also written in a completely different way. Here I'm coming in and out of php, and keeping the structure of html more visible: <?php foreach($posts as $post) { ?> <li> <a href='<?=$post->url?>'><?=$post->title?></a> <p><strong>Date:</strong><?=$post->date?></p> <?php foreach($post->image as $image) { ?> <!--code for the images here in html--> <?php }?> <?=$post->body?> </li> <?php } ?> For a start PHP book have a look at "PHP 5 For Dummies" by Janet Valade. No kidding- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
Thanks for the correction Ryan, and sorry Alex. It's even simpler than what I wrote- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
Thanks for the tips Ryan! I will make those changes edit: hm, I think I won't implement the second tip. For a matter of privacy, I think an unsubscribed email should be immediately deleted.
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
<?=$page->title?> is a shortcut to <?php echo $page->title?> to use the first form, it has to be supported by your server, so if your not sure, use the second form. In the same way as <? is a shortucut to <?php If you don't mind typing more, I would advise to use the complete version. You can use the same template for all categories. It should be something like this: <?php //find all the articles that have this category $articles = $pages->find("categories=$page"); //for each article found, print the fields you want foreach ($articles as $article) { echo "<h2>" . $article->title ."</h2>"; echo "<div class="body">" . $article->body ."</div>"; } ?> I didn't tested the code. Don't rely completely Maybe you could read an introduction to PHP. It's not difficult, and would help a lot to understand all this.- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
Good site Marty! It fits Andrea's work perfectly. I would like to be able to look at the background images (i know they work only as background, but still, they are nice). Have you considered giving the chance to hide the content by clicking on the background for instance? It could come back on a second click.
-
Display categories and create list of category links
diogo replied to Alex's topic in Getting Started
Your categories are in an array, so you have to iterate through them like this <? foreach ( $page->categories as $category ) { echo category->title . '<br/>'; }?> or, how i would probably do it: <? if ($page->categories){ echo '<ul class="categories">'; foreach ( $page->categories as $category ) { echo '<li><a href="' . $category->url . '">' . $category->title . '</a></li>'; } echo '</ul>'; }?> Edit: I don't know if you prepared a template for the categories pages to list all the post of each one there. But, because it makes sense, I changed the second block of code to reflect this.- 14 replies
-
- categories
- page field type
-
(and 1 more)
Tagged with:
-
I want to share with you guys the final solution that I implemented for this newsletter. So, I decided not to use any system like Mailchimp or Campaign Monitor (thanks for these and other suggestions, anyway). I wanted an extremely simple system, and decided to built it with PW instead. Collecting the emails is done in a very simple way: when the user inputs the email, it is sanitized and, if it doesn't exist, a new page with the email as title is created under a parent called "people". Like this I get a nice list of emails in the page tree. After this, the user gets a success message, and is sent a welcome email. $email = $sanitizer->email($input->post->email); if(!$email) { echo $pages->get(1023)->not_email; } elseif($pages->get("title=$email") instanceof NullPage) { $p = new Page(); $p->template = $templates->get("person"); $p->parent = $pages->get(1015); $p->title = $email; $p->save(); echo $pages->get(1023)->confirm; //send the email $to = $email; $subject = 'Willkommen'; $message = <<<EOT ...(here goes the html of the welcome email)... This email (and also the future ones) has a link for an unsubscribing page that looks for the imputed email and deletes it: $pages->get("title=$email")->delete(); if($pages->get("title=$email") instanceof NullPage) { echo $page->byebye; } else { echo $page->error; } The newsletter itself is also very simple. In this case we decided that periodically, the administrator will choose some of the posts from the blog to build the emails. So, I created a page "messages" that accepts children pages with a template that has only a date field and a pages select field. To send a message, the administrator creates a new page under "messages", chooses the blog posts that wants to include, publishes it and presses view. Here she is presented with a sample of how the email looks like, and a button "send" on the bottom. The email is sent, and she is redirected to the PW admin with a success message. Again, I kept it very simple because we wanted limited functionality, and maybe it needs some adjustments. But It could be much more complete, with the alternative to write a text and put images instead of only choosing the blog posts, for instance. And maybe even turned into a module.