Leaderboard
Popular Content
Showing content with the highest reputation on 04/19/2013 in all areas
-
5 points
-
Finally had a chance to test this new functionality and have been really impressed. For those wanting to try, here are the steps that I went though using the default site profile. In the following examples I am adding two languages English and German where the pages will be viewable with the language code preceding the url like /en/ and /de/ 1.Install the latest development version - here is the zip download - https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip 2. Install these 3 modules - Languages Support - Languages Support - Fields - Languages Support - Page Names 3. Add a new language via the Languages setup page - I think naming here is only relevant for your code and does not affect the URL of the page 4. Open up the home page and look at Settings tab - the name (url) field should now have a field for each language you have added. Add an indicator for each language like /en and /de English /en/ Deutsch /de/ This acts as a language gateway for changing the language. Now when ever you visit the site via /de it will set the users language to German and all the pages in the site will display the correct German language url. note: I have not worked out how to redirect the default language (which is English) to /en - it always goes to the site root / 4. Add a simple language navigation switcher. This will allow users to switch the current page into the other language. Edit : Refer to WillyC and Ryans language switcher further down - http://processwire.com/talk/topic/2979-multi-language-page-names-urls/page-3#entry33537 echo '<ul>'; $lang = $user->language; $langname = $lang->name == 'default' ? 'en' : $lang->name; $user->language = $languages->get('default'); $cssClass = $langname == 'en' ? 'class="active"' : ''; echo '<li '.$cssClass.'><a href="'.$page->url.'">EN</a></li>'; $user->language = $languages->get('de'); $cssClass = $langname == 'de' ? 'class="active"' : ''; echo '<li '.$cssClass.'><a href="'.$page->url.'">DE</a></li>'; $user->language = $lang; echo '</ul>'; I think that is pretty much it. All other PW development procedes as normal. I also just switched over from the LanguageLocalizedURL module on one site - it was actually pretty easy to do - just uninstalled the module and went through the steps above - thanks soma and mcmorry for the original module - it was very useful at the time, but will be moving over this mainly so I can start using the ProCache module. I have tested the new language fields with ProCache and it also works great! Super fast, one tree multilingual sites, with the same ease as developing a regular processwire site - this is so cool!5 points
-
this another language.swatch work wit any num.languagees new localUrl func echo "<ul>"; foreach($languages as $language) { $class="$language"=="$user->language" ? "active" : ""; $url=$page->localUrl($language); echo "<li class=\"$class\"><a href=\"$url\">$language->title</a></li>"; } echo "</ul>"4 points
-
Hi, I wish to have a core ImageManipulationClass like the ImageSizer but not only for resizing and cropping images. It should provide these easy to use functionality like with the ImageSizer and additionally a step to step image manipulation whereas the user / module author is not restricted anyhow. The basic image manipulation methods should be included, like: im_flip im_rotate im_crop im_crop_auto im_resize im_sharpen im_stepResize If someone want to do something more fancy or magic, he/she should not to have to reenvent the basics again. He/She just should start with the class by opening the imagefile and create a GD-object, use some basic methods, and at any point get the GD-IM-Reference out, do his fancy magic with it and put it back to the class to use its basics to finalise the file: im_get_im() im_set_im( &$im ) I have started to write something for this. I tried to be as close to the ImageSizer as possible, but some differences will be there. Before I've started with it I have done some tests with sharpening, rotating and others. First I've tried to create a module that hooks into ImageSizer, but have figured out that this wouldn't solve most things what I imagine one want to do with images. I have read the code of ImageSizer very carefully and there are allready very good inprovements in it from the community here. Ok, Ryan has written it and done the most work of all, so tribute to him , - adamkiss, interrobang, mrx, teppo, u-nikos have contributed the improvements to it: . I have looked into apeisas Thumbnail-Module and tried adding functionality for sharpening to it. It think he would have liked if there was a CoreImageManipulation class once when he has written the module. Also Soma actually work on a very cool Module where I really would like to see a link/button or some links/buttons for every image that just let you do some manipulations/corrections to them. <hint, hint ;-)> Any thoughts or Meinungen are welcome. --- EDIT: there is actually a modified ImageSizer class with autoRotation & sharpening available for testing: http://processwire.com/talk/topic/3278-core-imagemanipulation/#entry32284 --- Here are an overview of what allready is in, (I post only properties and method names, not the method bodies): class ImageManipulation extends Wire { // information of source imagefile /** * Filename ImageSourcefile */ protected $filename; /** * Extension ImageSourcefile */ protected $extension; /** * Type of image ( 1 = gif | 2 = jpg | 3 = png ) */ protected $imagetype; /** * Information about the image (width/height) and more */ protected $image = array(); /** * Was the given image modified? */ protected $modified = false; // default options for manipulations /** * Image quality setting, 1..100 */ protected $quality = 90; /** * Allow images to be upscaled / enlarged? */ protected $upscaling = true; /** * Allow images to be cropped to achieve necessary dimension? If so, what direction? * * Possible values: northwest, north, northeast, west, center, east, southwest, south, southeast * or TRUE to crop to center, or FALSE to disable cropping. * Default is: TRUE */ protected $cropping = true; /** * Should a optional Auto-Rotation be performed if EXIF-Orientation-Flag is available? */ protected $auto_orientation = true; /** * the default sharpening mode * * @var array with custom pattern or a string: 'soft' | 'medium' | 'strong' | 'multistep' */ protected $sharpening = 'medium'; /** * if extended imageinfo should be retrieved: number of Channels, Bits/per Channel, Colorspace */ protected $extended_imageinfo = false; /** * Extension / Format for resulting Imagefile (default is same as ImageSourcefile-Extension) */ protected $outputformat; /** * Filename ImageTargetfile if $outputformat is different than InputImage (default is same as ImageSourcefile) */ protected $targetfilename; // other properties /** * Directions that cropping may gravitate towards * * Beyond those included below, TRUE represents center and FALSE represents no cropping. */ static protected $croppingValues = array(); /** * Supported image types (@teppo) */ protected $supportedImageTypes = array(); protected $option_names = array(); private $property_names; // Methods to set and get Properties /** * Here you can specify multiple options as Array, whereas with the * single set* functions you can specify single options * * @param array $options May contain key-value pairs for any valid Options-Propertyname * @return this */ public function setOptions(array $options) public function setQuality($value) public function setUpscaling($value) public function setCropping($value) public function setAuto_orientation($value) public function setSharpening($value) public function setTargetFilename($value) public function setOutputformat($value) /** * Return an array of the current options */ public function getOptions() /** * makes protected and private class-properties accessible in ReadOnly mode * * example: $x = $class->propertyname; */ public function __get( $property_name ) // Construct & Destruct the ImageManipulator for a single image public function __construct( $filename, $options=array() ) public function __destruct() public function im_release() // read image informations, basic and extended protected function loadImageInfo() private function extendedInfo_gif(&$a) private function extendedInfo_jpg(&$a) private function extendedInfo_png(&$a) // helper functions /** * check file exists and read / write access * * @param string $filename * @param boolean $readonly * @return boolean */ private function check_diskfile( $filename, $readonly=false ) /** * helper, reads a 4-byte integer from file */ private function freadint(&$f) // the IM's (ImageManipulation Methods) private $im_dib_dst = null; // is the output for every intermediate im-method and optional a check-out for the im! private $im_dib_tmp = array(); // holds all intermediate im references private function get_next_im( $w=true, $h=null ) public static function is_resource_gd( &$var ) public function im_get_im() public function im_set_im( &$im ) public function im_flip( $vertical=false ) public function im_rotate( $degree, $background_color=0 ) public function im_crop( $pos_x, $pos_y, $width, $height ) public function im_crop_auto( $direction, $width, $height ) public function im_resize( $dst_width=0, $dst_height=0, $auto_sharpen=true, $sharpen_mode='medium' ) public function im_sharpen( $mode='medium' ) public function im_stepResize( $dst_width=0, $dst_height=0 ) // static oneLiner Methods that can be called only with a filename passed to them public static function file_get_exif_orientation( $filename, $return_correctionArray=false ) public static function file_jpeg_auto_rotation( $filename, $quality=95 ) }3 points
-
Good question. This is one of those "one man's meat is another man's poison" sort of situation. There are so many different approaches to doing your template files...No one approach is superior (in most cases ) to another. It is an issue of preference. You can even decide you want all your HTML code with PHP inside in one file. This can result in very long, hard-to-grasp code though. You can decide not to name your includes as .inc but .tpl..PHP will happily include them when asked to do so....Or, you can have as many .inc as you wish to make your head spin trying to guess what is including what . I hope it doesn't confuse you more but have a look at this thread. It has lots of wonderful ideas about approaching your template files. Having .inc files also helps with dynamism. For instance, your website can have the same header throughout but different footers depending on the page being viewed. There can be a sidebar.inc as well, which will only appear in certain pages and show a sub-menu, a featured article, etc.... I am working on a short tutorial part of which I hope to post here soon...(and on my website whenever that materialises ) about visualizing your site structure before you build it. Planning is important in these things. Again, people have different approaches. I like to think diagrammatically, at the whole system level. Such an approach helps me visualise the template approach to adopt for a particular job. For instance, what areas of the website are common/shared? What is unique to some pages? How best can I code/design/plan my templates and template files to achieve what I want making best use of logic, KISS and DRY principles and balancing this against common sense and ease of understanding the code? If I come back to the code in a month's time, or if somebody took over my task, would I/they be able to make sense of it all? Sorry for digressing somewhat3 points
-
Ha, I did it! Instead of $pa = new PageArray(); $value = $pages->find( "title%=$q" ); $pa->import( $pages->find( "template=abc, …|…|…=$value" ) ); $pa->import( $pages->find( "template=abc, title%=$q" ) ); I wrote this $pa = $pages->find( "template=abc, bla1.title|bla2.title|bla3.title|…|title%=$q, limit=4" ); I don’t search for the page references but for the titles of the page references with ".title". Works like a charm.3 points
-
Lea Verou explains Regular Expressions. This is actually very easy to follow! Her RegExp playground is pretty cool too http://leaverou.github.io/regexplained/. And since we are at it, check out this Regexp editor by Cody Lindley http://jsfiddle.net/codylindley/u4E6P/2 points
-
Think of the template file as a puzzle, and the inc files as the pieces of the puzzle. The goal is to draw an html file in the browser, and each piece does it's part. Because php doesn't understand html tags, the pieces of the puzzle don't correspond necessarily to the complete html tags, they just draw the puzzle from top to bottom, unaware of what they're drawing, until it's complete.2 points
-
Truth of the day: - WordPress is one of the most downloaded CMS so they must be doing something correctly. - specially for the germans: BILD-zeitung is the most selled Newspaper, so they must be doing something correctly. Yes of corse they will do something correctly, but what does it tell me about the quality / usability of it? --- Petsagouris, I have had two quick views to this lib, and it is like it is with most others of them: 1) sharpening - https://github.com/avalanche123/Imagine/blob/develop/lib/Imagine/Gd/Effects.php they have 1 pattern! That's that pattern that is into all libs that have sharpening and of corse you can find it all over the web. (php.net usernotes, stackoverflow, etc, etc). With the new addition to ImageSizer we now have 3 patterns (soft, medium, strong). (and they are well tested over a set of 30 images, from lowkey to highkey covering not only most common scenes). Maybe that in a year the other libs have them included too, because they have found them here in PW. who knows And, last but not least: sharpening isn't a _effect_, sharpening is essentially image processing. And there exists more than 20 different common methods to apply sharpening to an image. One of that is added to the ImageEditors sharpening method, it's called multistep-sharpening! So with it we now have 4 different patterns available, and you also may pass an array to the method with your own pattern, if the available do not suite your needs in some cases. (with this the advanced users have much more than 4 patterns that they can apply to an image) I don't know who are the people what have done all those libraries. They may be good or very good developers or enthusiats and they may have done really good work or awesome work, - but one thing is fact: I'm sure there are no photographers with them. ;-) (Don't go to a butcher when you want to buy a bread!) 2) there should be only the basics in it, in ImageSizer and in ImageEditor. But these should be robust and with a high comfort for users who don't know much about image-processing but may expect an equal behave like they know from PW. And with ImageSizer this is allready reached because of The only thing what was really needed and wasn't in there was a good sharpening. There is all in what is needed to do a perfect job with resizing, - regardless of image formats, filenames, transparencies, and what ever. But not more! And ImageEditor should be like that with what could be usefull for most users handling images in an CMS, and not more! At first it should be a tool for module authors who want to deal with images, so that they haven't to go and take a sharpening method from somewhere in the web without really knowing what it does / how it works. They should be able to simply resize an image, and sharpening is applied automatically. (They even have not to know about the fact that images could/should be sharpened when resized, - like I can store some Text into a PW-Page without have to know how a DB works on that).2 points
-
Pagination module doesn't work with in memory page arrays. Once you manipulate or merge arrays you operating in memory. Pager does need a single find db query to work. You'd need to create your own pager functions for in memory page arrays using the start and limit selectors.2 points
-
@k07n: I'ts just a matter of tastes there. I honestly prefer to write all the php first (In this particular case the foreach loop) and then echoing the results inside html tags. Doing so I avoid to forget the closing php tags each time, and for me it's more readable also.2 points
-
2 points
-
Not sure about collapsing the code window - don't think I've seen that option in this forum. But, back to your problem - all that your RSS page should be outputting is: <?xml version='1.0' encoding='utf-8' ?> <rss version='2.0'> <channel> <title>Latest updates</title> <link>http://localhost:8888/livio/rss/</link> <description>The most recent pages updated on my site</description> <pubDate>Thu, 18 Apr 2013 16:24:55 +0200</pubDate> <ttl>60</ttl> <item> <title>Sintel</title> <description><![CDATA[InfoPassepartout had a moist sensation about the eyes; his master's action touched his susceptible heart. Two first-class tickets for Paris having been speedily purchased, Mr. Fogg was crossing the station to the train, when he perceived his five friends of the Reform. "Well, gentlemen," said he, "I'm off, you see; and, if you will examine my passport when I get back, you will be able to judge whether I have accomplished the journey agreed upon." "Oh, that would be quite unnecessary, Mr. Fogg," said Ralph politely. "We will trust your word, as a gentleman of honour." "You do not forget when you are due in London again?" asked Stuart. "In eighty days; on Saturday, the 21st of December, 1872, at a quarter before nine p.m. Good-bye, gentlemen." Phileas Fogg and his servant seated themselves in a first-class carriage at twenty minutes before nine; five minutes later the whistle screamed, and the train slowly glided out of the station. The night was dark, and a fine, steady rain was falling. Phileas Fogg,]]></description> <pubDate>Wed, 03 Apr 2013 13:54:47 +0200</pubDate> <link>http://localhost:8888/livio/movies/sintel/</link> <guid>http://localhost:8888/livio/movies/sintel/</guid> </item> <item> <title>Big Buck Bunny</title> <description><![CDATA[]]></description> <pubDate>Thu, 04 Apr 2013 14:25:48 +0200</pubDate> <link>http://localhost:8888/livio/movies/big-buck-bunny/</link> <guid>http://localhost:8888/livio/movies/big-buck-bunny/</guid> </item> <item> <title>Tears of steel</title> <description><![CDATA[]]></description> <pubDate>Thu, 04 Apr 2013 15:41:36 +0200</pubDate> <link>http://localhost:8888/livio/movies/tears-of-steel/</link> <guid>http://localhost:8888/livio/movies/tears-of-steel/</guid> </item> </channel> </rss> Seems to me that your rss.php template has your header and footer includes in place. That file should just have the code you posted in your first post, and nothing else. Try that and let us know how you go.2 points
-
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 helpful2 points
-
Some $_SERVER variables like HTTP_REFERER can be manipulated by the client, so it's probably not safe to utilize without sanitization. However, since you are trying to keep track of the last page, I'd suggest using the $session variable. Place this at the top of your page before output: if($session->referrer_id) $page->referrer_page = $pages->get($session->referrer_id); $session->referrer_id = $page->id; Now anytime you want to access the last page, you'd do this: if($page->referrer_page) { echo "Last page you visited was: " echo "<a href='{$page->referrer_page->url}'>{$page->referrer_page->title}</a>"; }2 points
-
Hi, After reading this thread, I decided to make a module that helps generating PDF files of ProcessWire pages. GitHub: https://github.com/wanze/Pages2Pdf Modules Directory: http://modules.processwire.com/modules/pages2-pdf/ This module uses the mPDF library to generate the PDF files. It has fully UTF-8 and basic HTML/CSS support for rendering the PDF files. The output is customizable with ProcessWire templates. Example I've enabled generating PDF files for the skyscraper template of ryans Skyscrapers-profile with a template that outputs the data in a table along with the body text and the images: one-atlantic-center-pdf-4177.pdf Please take a look at the README on GitHub for instructions and further information/examples. Cheers1 point
-
Thanks Wanze, Was hoping there was a PW way. I ended up using the following: $images = $page->$image_field->getArray(); natsort($images); $reversed_images = array_reverse($images); $sortedImages = new WireArray(); $sortedImages->import($reversed_images); $page->$image_field = $sortedImages; I had to reverse the array, I am guessing because of the way import brings them in, so that they are in the correct ascending order. After the final line I make a few more changes to the $page and then save it. Anyway, this seems to work fine.1 point
-
Without emulating $imgArray = $images->getArray(); natsort($imgArray); // continue with $imgArray or... $images = new WireArray(); $images->import($imgArray); Not tested1 point
-
auther of imagine want to join pw mabe he work withe horst ? horst work withe pw not mammajoomla or daddadrupal mabe imagine nice but not as nice as havings coder horst withe pw1 point
-
1 point
-
I think you both have valid points from your perspective. I think it comes down to that we're having the current ImageSizer getting some enhancement and trying to keep improving it and not having a dependency on an other lib which would need to be maintained also. The matter image and all its facets is such a huge subject in web development it's hard to sometimes argue about it. It's great to have some movement here happen and we all appreciate the work you do horst. It's also nice to suggest a different approach but it somehow sparked unwanted reactions because theres some good free time spent here. It's like telling someone after building his dreamhouse why not buy a house thats already built.1 point
-
Sorry if I didn't explain well. The approach of having the content div open in the head.inc and close in foot.inc is just to make your life easier. You could have the head.inc just contain the html declaration, head tags, and things like banner and navbar, and have the footer contain just the footer div itself, but then you'd be stuck with needing to add the content div open and close tags in each template file. diogo's reply just came through and I think he explains it very well. PHP really does just string these elements altogether in the order you specify until the final HTML doc is built. It's pretty cool really1 point
-
Haha, yeah, that was my initial plan and for that I needed to know how to get city name when theatre is connected to the show So this completes the thought cycle I guess. For future reference for all the non-programmer guys like me, I'll keep this thread updated with my learnings.1 point
-
Just wanted to correct a missunderstanding that I've read in the beginning... Haven't ready through all so sorry if you guys already solved it. If you have a page field multiple or single it will be a PageArray or a Page reference, so you can iterate them with foreach. No need to get the pages through id's or anything like that, they're pages objects already. foreach($page->drama_theatres as $drama){ echo $drama->title; } or if a single page reference field echo $page->drama_theatre->title;1 point
-
Guess I am a bit confused as to the page structure that you have set up. You could do something like: City 1 Theatre 1 Show 1 Show 2 Theatre 2 Show 1 Show 2 City 2 Then the admin just has to create a new child 'show'under the appropriate theatre. There may be better ways to organize this depending on your needs on the front end. You could also follow Ryan's skyscrapers setup, and use some of that logic. Have you seen his demo: http://processwire.com/skyscrapers/admin/1 point
-
$value = $pages->find( "title%=$q" ); $pa->import( $pages->find( "template=abc, …|…|…=$value" ) ); $pa->import( $pages->find( "template=abc, title%=$q" ) ); What should that do? You have to explaing a little more for a short minded like me. I have an example that shows how to construct your own pager using the PW PagerNav class: // include paginator class require_once($config->paths->MarkupPagerNav . "PagerNav.php"); $pa = new PageArray(); $res1 = $pages->find("template=xyz, title%=space"); $res2 = $pages->find("template=abc, title%=hal"); $pa->import($res1); $pa->import($res2); // config paginator $baseUrl = $page->url; $limit = 4; $start = ($input->pageNum - 1) * $limit; $total = $pa->getTotal(); $pagerNav = new PagerNav($total, $limit, $input->pageNum); $pager = $pagerNav->getPager(); // construct paginator markup foreach($pager as $link) { if($link->pageNum == $input->pageNum) $class .= "on"; if($link->type == "separator") $item = '…'; else $item = "<a class='$class' href='{$baseUrl}page{$link->pageNum}/'>$link->label</a>"; $pagerMarkup .= "<li>$item</li>"; } // output paginator markup echo "<ul class='pager'>" . $pagerMarkup . "</ul>"; echo "total: $total<br/>"; echo "start: $start<br/>"; echo "limit: $limit<br/>"; echo "<ul>"; foreach($pa->find("start=$start, limit=$limit") as $p){ echo "<li>$p->title</li>"; } echo "</ul>"; Also in my ever growing gist examples https://gist.github.com/somatonic/54205361 point
-
Do you have the page field set to multiple or single in the details tab?1 point
-
1 point
-
Hi vineonardo Do you mean this? // In Template drama // Get all theatres foreach ($page->drama_theatres as $theatre) { echo $theatre->theatre_city; }1 point
-
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.1 point
-
Most of the examples that you will find here on the forum use the first method, and thats's also the one I tend to use, but the second method has it's merits. If you worry about how the source code looks (before firebug and chrome developer tools it was important for debugging) the second method respects the indentation and keeps the html tidy, although you can also achieve that inside a php with \t and \n (tab and newline characters): echo "\t\t\t<li><a href='{$planet->url}'>{$planet->title}</a></li>\n";1 point
-
Maybe in beginning of your prepend template (ie. _head.inc) something like this: if ($page->is("template=rss|specialtemplate")) return;1 point
-
Image manipulation is something that has been dealt with many times, please, please use an existing library for this. Imagine is the most downloaded and starred lib for this on packagist so they must be doing something correctly.1 point
-
Right...as diogo says, i mean wiring it by connecting the the design to the content...1 point
-
@pwired, i think Macrura's 'wiring' has the same origin as the 'wired' in 'pwired', and not in 'wireframing'1 point
-
Welcome jzvanenk! Answering directly to your question. The snippets don't go inside the fields, they go directly on the template files. The code you have on the template files is PHP, just like the snippets yo are talking about. So, when you have this on the planets tutorial: <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <h1><?php echo $page->title; ?></h1> <h2>Type: <?php echo $page->planet_type; ?>, Age: <?php echo $page->planet_age; ?> years</h2> <p><?php echo $page->planet_summary; ?></p> </body> </html> You can also have this: <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <header> <ul id="all-planets"> <?php // list all planets and link to their pages foreach($pages->get("/planets/")->children as $planet){ echo "<li><a href='{$planet->url}'>{$planet->title}</a></li>"; } ?> </ul> </header> <h1><?php echo $page->title; ?></h1> <h2>Type: <?php echo $page->planet_type; ?>, Age: <?php echo $page->planet_age; ?> years</h2> <p><?php echo $page->planet_summary; ?></p> </body> </html> edit: that is the same as this (entering and leaving php to write html): <html> <head> <title><?php echo $page->title; ?></title> </head> <body> <header> <ul id="all-planets"> <?php foreach($pages->get("/planets/")->children as $planet): ?> <li> <a href="<?php echo $planet->url; ?>"><?php echo $planet->title; ?></a> </li> <?php endforeach; ?> </ul> </header> <h1><?php echo $page->title; ?></h1> <h2>Type: <?php echo $page->planet_type; ?>, Age: <?php echo $page->planet_age; ?> years</h2> <p><?php echo $page->planet_summary; ?></p> </body> </html>1 point
-
1 point
-
Here you go: http://modules.processwire.com/modules/fieldtype-text-unique/1 point
-
There's absolutely no technical reason behind these -- if I had to guess, I'd say that latter case just looked slightly better without the semicolon.. or it could have been simply an oversight, who knows. Personally I try to use semicolon at the end of each statement, one-liner or not, just to keep things consistent1 point
-
I'm planning to bring the same import/export system that's in FormBuilder to Fields and Templates.1 point
-
There's a couple of ways to approach this. I can't find the forum posts atm but Ryan and others have addressed this before. One, it sometimes depends on how you have organised your pages (e.g. used sections or not?). On the other hand, some sites will have lots and lots of pages. Here, PW offers pagination. Btw, "several hundred" is not that much. Have a look at the skyscraper profile. I get your point though. However, in some cases, it does not make sense to have all your data as PW pages. This is especially in the case where those pages do not need individual URLs. For instance, a directory listing company employees. One could have this in their own database tables and have those called and displayed on one PW page. OK, back to some solutions. Have a look at this module by Soma.That can be customised to suit your needs. Going the custom database tables means you will miss out on the wonderful PW API. As for admin themes, as you know, creating your own admin theme in PW is a breeze..1 point
-
I'm thrilled to see the final result. +1 Horst for your Idea. Would be another great example of PWs flexibility1 point
-
1 point
-
Hi Ryan and Soma and Dave, thanks for getting back to me. In the Edit Template for Basic Page under Access, I see the following permissions: View Pages Edit Pages Create Pages Add Children Ideally it would be great if there were two other permissions: Delete Pages Move Pages I would think that "Delete Pages" would already be there. Perhaps I'm missing a setting somewhere. Locking the template seems to lock the client out of edits. But I want to allow him to edit the page, just not delete the page. But barring a new release of PW with my wishlist of new permissions, perhaps I could write a module where at least I could hard code these permissions for certain page ids. Restricting Deletion while allowing Edits would be crucial. Restricting a page so that it cannot be moved is a "nice to have". A lot of my requirements are on a page by page basis where it would be nice to mark a certain basic page as "un-deletable" or "un-moveable" while keeping the same template for other pages where the client would have free reign. If you could help get me started, I would appreciate it.1 point
-
That's not correct. Nothing you do will get overwritten on update you just replace /wire/ folder, unless you modify something in there you're save to change whatever template you wish and it will stay there.1 point
-
As an ex-MODxer myself who's been using ProcessWire for almost 2 years I can confidently say ProcessWire will handle everything you need. Much of what you're after are features I've built myself on one site or another with ProcessWire so you're definitely in the right place to build the site you want in a fraction of the time compared to doing it from scratch - once you get going I'm sure you'll be amazed at how fast you can get things built without having to touch a line of SQL or create any custom tables in your database since ProcessWire does that side of things for you1 point
-
Greetings Luis, Excellent work! I hope lots of people purchase it! This is a great inspiration to anyone working on building various applications with ProcessWire. Thanks, Matthew1 point
-
Don't use images in text wysiwag. Seriously. I think u can avoid a lot of issues. Think if you replace img with a different size and ratio. I stoped doing it and use other ways a long time ago. You just give away control, and editors start to think they need to do design. All websites we done with free images in text are horrible after 1 month in hand of a client and lots of maintenance needed. Use repeater to make blocks with images and a option to align or size. Or intext tags where to put image. Theres even a module. And your back in control. And other nice effect.1 point