-
Posts
295 -
Joined
-
Last visited
-
Days Won
5
Posts posted by Luis
-
-
I found a documentation about the famous silk road by the swiss journalist Peter Gysling.
Watch it: http://seidenstrasse.srf.ch/de/home.html
You just have to scroll down, unfortunatly the site is in german but the pics and the technical realisation is just worth it.
- 4
-
My little workaround
<?php if(!$input->post->import && !$fieldsImport && !$input->post->generate): ?> <hr /> <h4>Separate Fields by comma like this: i,am,a,new,field</h4> <form name="importform" method="post" action="./"> <div class="span3"> <p><label>Field Prefix?</label> <input type="text" name="prefix" /></p> </div> <div class="span3"> <p><label>Field Tag?</label> <input type="text" name="fieldtag" /></p> </div> <div class="span3"> <p><label>assign to </label> <select name="template"> <option></option> <?php foreach($templates as $singleTemplate): ?> <option value="<?php echo $singleTemplate->name ?>"><?php echo $singleTemplate->name ?></option> <?php endforeach ?> </select> </p> </div> <div class="span12"><textarea name="string"><?php echo $input->post->string ?></textarea><p><input type="submit" name="import" value="import" /></p></div> </form> <?php endif ?> <?php if($input->post->import){ $fieldsImport = $input->post->string; $fieldsImport = explode(',', $fieldsImport); } if($fieldsImport): ?> <hr /> <form name="fieldform" method="post" action="./"> <div class="row"><div class="span12"><hr /></div></div> <ul> <?php foreach($fieldsImport as $fieldNew): ?> <?php $alleTypes = '<select class="required" name="'.$fieldNew.'"> <option selected="selected" value=""/> <option value="Checkbox">Checkbox</option> <option value="Email">Email</option> <option value="File">File</option> <option value="Image">Image</option> <option value="Page">Page</option> <option value="Text">Text</option> <option value="Textarea">Textarea</option> <option value="URL">URL</option> </select>'; ?> <li><?php echo $fieldNew ?> <?php echo $alleTypes ?></li> <?php endforeach ?> </ul> <input type="hidden" value="<?php echo $input->post->prefix ?>" name="prefix" /> <input type="hidden" value="<?php echo $input->post->template ?>" name="template" /> <input type="hidden" value="<?php echo $input->post->fieldtag ?>" name="tag" /> <input type="submit" name="generate" value="generate" /> </form> <?php endif ?> <?php if($input->post->generate){ $prefix = $input->post->prefix; $tags = $input->post->tag; $template = $input->post->template; $addedFields = $fieldgroups->get('name='.$template); foreach($input->post as $key => $val){ if($key != 'prefix' && $key != 'tag' && $key != 'generate' && $key != 'template'){ $f = new Field; if($prefix){$f->name = $prefix.'_'.$key;}else{$f->name = $key;} $f->type = $val; $f->save(); $f->tags = '-'.$tags; $f->save(); $addedFields->add($f); $addedFields->save(); echo "$key = $val <br />"; } } } ?>
- 4
-
Note:
The closing tag of a PHP block at the end of a file is optional, and in some cases omitting it is helpful when using include or require, so unwanted whitespace will not occur at the end of files, and you will still be able to add headers to the response later. It is also handy if you use output buffering, and would not like to see added unwanted whitespace at the end of the parts generated by the included files.
From: http://php.net/manual/en/language.basic-syntax.instruction-separation.php
- 5
-
ok, a little sum up.
To understand what happens, here is the setup:
Page called Clients, container for every client.
every client got his unique number written to the title.
The client template itself contains a set of round about 35 fields.
I imported a set of data via CSV import Module.
This set is provided by a client of mine who needs a new Intranet Solution.
His client Database contains exactly 15987 entries.
Every entry is one client and so every client is a page.
As you can see in the screenshot, PW provides a automatic pagination.
To handle this amount of data pagination is definitly not the best way.
To edit and manage some clients you could use the built in search engine in the backend.
Maybe I want to edit clients with the name Richard.
I just pick my Clients Name field, type Richard in the Search box, et voila.
What also could be interesting, is the performance of PW.
Lets have a look:
<? $pages->find('template=kunde'); ?>
All clients in one PageArray gives me the following : Page generated in 33.5099 seconds.
<? $pages->find('template=kunde,limit=50'); ?>
Results in : Page generated in 0.0376 seconds.
Rendering those sets of data doesnt affect our render time much. The following:
<? foreach($pages->find('template=kunde,limit=50') as $client): ?> <p>Number: <?= $client->title ?></p> <? endforeach ?>
Results in: Page generated in 0.0462 seconds.
Conclusion:
At a certain point you dont have to worry about how to order pages, instead you have to worry about how to catch your pageArrays as efficient as possible.
Managing large amounts of data is somewhat to think about at the very beginning.
I´m handling the clients in a tree like this: Home/Database/Clients/
Hope this was helpful
- 5
-
Smells like a casestudy
- 2
-
Im really busy these days, but fyi I setup a pw system with ~ 15.000 pages.
Trying to write a little review the next days.
- 1
-
Mh Joshs html kickstart,Twitter bootstrap,zurbs Fundation, gumby... pick one of those. They all provide some tab thingy
-
-
I'm thrilled to see the final result.
+1 Horst for your Idea.
Would be another great example of PWs flexibility
- 1
-
Please Philip,
I know your sites, can't imagine that they don't want to stay this long on your sites
You are right, gonna try to fix this issue today after work.
- 1
-
Uh nice,
a lot of little cupcakes inside your code to pick and learn from.
- 1
-
Would you share your solution with us?
-
You could check checkboxes like this:
if($checkbox)
and
if(!$checkbox)
example:
if($page->checkbox) echo 'i am set';
if(!$page->checkbox) echo 'i am not set';
So to modifiy your output in a foreach just put your markup in an if condition.
- 1
-
not 1337 ?
-
-
To add various events on the same day via Processwire and stored pages we have to edit our existing getEvents() function and we have to change the way we store events.
According to my first example we stored events like this:
Children of /calendar/ with date and event entry as our single calendar event.
Now we change this way a little bit.
We create calendar events by date and add children to this day.
Something like this:
/calendar/01-01-1970/deployunix6/
/calendar/ -> is our events container
/01-01-1970/ -> is our day container
/deployunix6/ -> one event at the 01-01-1970
This way we could avoid redundant information in our pagetree and easily maintain our calendar.
In the next step we edit our getEvents() function.
function getEvents(){ $days = wire('pages')->get("/calendar/")->children("sort=title"); foreach ($days as $day) { echo "'$day->title' : '"; $events = $day->children("sort=created"); foreach ($events as $event) { echo "<span><p>$event->title</p></span>"; } echo "', \n"; } }
- 1
-
Code example tomorrow, just arrived at home, le me now @ couch
- 1
-
Ryan,
i'm setting up a blog for my wifey and mh she is always a little bit like indiana jones and explores all given functions.
So I tried to setup a module to just provide the tree of posts and a button "Add new Post".
I struggle a bit with the asmselect now to rebuild the new post page, so is there an easier way to achieve this, other than rebuild the whole "new page" page?
-
on my todo. Thanks Ryan
-
v 0.0.1 up on gitHub and pushed to module directory
-
thanks for your responses
@photoman355 :
The intention why I choose TinyMCE is pretty simple, the user knows tiny from the backend, so he might feel comfortable to tiny.
I didn't faced any problems with integration so far, just finished the jquery thingy to add the needed divs, a's etc...
Just tried to keep it on a very simple and basic approach, just click on the $page->body content and change the text on the fly, not more. For further editing you still have to go to the backend.
Further editing just feels wrong on the frontend.
-
What it does:
turns the content of $page->body into a clickable area and gives the ability to frontend edit the content via tinyMCE
Release:
In the next days. (my aim is tomorrow evening)finished with v0.0.1
- 7
-
if $page->title == $child->city ?
Or is this to obvious that I misunderstood your question?
-
I'm in
Web Application - Intranet Office suite
in Case Studies
Posted
you mean something like $price * ($variable) e.g. 19,95 € * 1.1 ?
Nope, something is not implemented.
I'm working with different prices on same products, like Coding - Hard = 500€ and Coding - Easy = 250€