Leaderboard
Popular Content
Showing content with the highest reputation on 09/29/2015 in all areas
-
Hi everyone, This is an early (but mostly functional) version of a module that I am experimenting with for automatically populating all empty fields on a page. It is designed for use during site development and should be uninstalled once the site is live. https://github.com/adrianbj/AutoContent (anyone have an idea for a better name?) It currently supports the following field types: Text - outputs "This is an example Field Label", where "Field Label" is the label for the field Textarea (RTE and plain) - configurable content from http://loripsum.net/ and embedded images from http://lorempixel.com Datetime - honors output formatting and returns random date/time with configurable min/max datetime Integer - honors min and max settings Float - honors min, max, precision settings URL - returns a random URL Email - returns a random email address Image - you can specify image category (people, nature, business, etc), and the range for min/max number of images to generate. Page - creates runtime selected child page content for output - not well tested yet. MapMarker - not well tested yet! I will be adding support for Profields and other selected 3rd party fieldtypes shortly. Highly configurable content is provided by: http://loripsum.net/ http://lorempixel.com/ https://github.com/fzaninotto/Faker Generated content can be localized to your region - very handy for addresses, people's names, phone numbers etc: Many fieldtypes are configurable via the Input tab on the field's config settings, eg: Textarea: Text: Images: Datetime: In general I am designing this to work with minimal/no configuration so you can install and have all fields on all pages on your site immediately populated for testing layout and styling without the need for manually adding dummy content. There is also a dummy page batch creator and deletor (automatically tracks and deletes just the dummy pages) available from the module config settings page. Please let me know if you think you will find this useful - trying to get an idea of how much time to put into support for additional field types.14 points
-
Not APIs, API. Hopefully I don't sound too rude (in a bit of a hurry here), but please check out the docs section. It's all explained there. In addition to that, I'd suggest taking the time to browse through some of the tutorials, in case you prefer a hands-on approach. The kind of questions you're asking here are perfectly understandable from someone just getting started with the system, but it also sounds like you haven't really bothered checking out the docs either. Also, the forum is filled with answers to very similar questions, so you might want to try looking around a bit. To be fair most of your current confusion seems to stem from not understanding many of the basic concepts of ProcessWire, including how it handles content and content types. While it's a bit outdated by now, Ryan's excellent overview video is still a very good starting place in this regard; the UI will look different from what you'll see on your site and your site will have more options and settings to play with, but the basic concepts are the same.5 points
-
Displays countries and continents and their iso codes. The "value" for each country is the two-letter country code. As an added bonus, the country names are displayed in the language of the user (sorted by name ASC) if the appropriate translation was added. read more ...2 points
-
let me add some more information you could provide as there was... PW version, screenshots of your template settings. but christophe has wrote the right and important hint already... What profile you used as start for the tutorial? If you get header and footer rendered you should check the settings for prepending and apending templates or includes....so check if you have a _init.php or something else in your profile. For a beginner it could be very strange to get started in face of the many many many options you can take. If you are getting more familiar with the system and find your own way to use templates and site profiles you will love the given freedom. Like in many other topics wrote a: Site profile is only the place to play for your own frontend. Template "files" in the profile are only showing content or data in the way you build it (html,css,json,file,everything you want) Templates itself - with or even without a file (for special contenttype or backend only content...) are a kind of building your content and data model for different needs, you have the power to give them the fields you need, you could connect templates(contenttypes) with Pagefields (example template autor is connected with a pagefield to every article this autor wrotes), you could setup the given fields with various field dependencies, using hooks and much more to get what is needed or should be the final result. Pages are every piece of data, object and could represent every type of content you "preset" with given fields and settings on the used template... Best place to read for beginners is a great writeup for beginners on every important topic....the footer/header includes, too it's a big topic from pwired but it helped me very very much at the starting questions....so take a good read on this. What helped me very fast to get started on the template/field/page thing are some couple of videos, too. Best regards mr-fan2 points
-
2 points
-
About a week or so ago i was thinking, it would be nice to have a module that can add dummy content Maybe an early feature request (if its not already in your module). An auto page generator, where one can set: - the amount of pages to create - pick a parent page - pick a template For example: - 15 - /news/ - news-article Then it will create 15 news articles with Lorem ipsum text and dummy images2 points
-
Apparently, sexiness http://vschart.com/compare/processwire/vs/silverstripe2 points
-
Perhaps you should ask about PHP's future instead. ProcessWire is only a tool that helps you utilizing its features. There might come other similarly handy tools in the future but currently it's among the bests. So I guess PHP will stay with us for a while and I'm sure PW too1 point
-
Or a redirect....it can do lots of wonders .. Welcome to the forums1 point
-
It depends how you define "longterm". We (Avoine) started using ProcessWire 2011 for inhouse projects and 2012 for clients. 6 years soon, and I feel we are just getting started. PW 2.0 was released 2010, but it's roots are in 2003: https://processwire.com/about/background/ So I would say PW is longterm.1 point
-
I get your point: will Processwire still exist in the future ? This question has been asked a few times already and to my opinion answers have been a bit vague about it. But the answer is: yes Processwire will still exist in the future. Even in the worst case scenario when no developer team would exist anymore. I base my opinion on the fact that the core of Processwire is coded so very well, that it is php version proof for a long time to come. But that worst case scenario is very unlikely to happen. As you may have noticed, both developers and coders are attracted to Processwire for the beautiful way how it works and therefore it is no coincedence that the forum of Processwire is filled with high skilled coders. So, if for whatever reason the developers team would cease to exist, other coders will step in immediately to continue Processwire. If your thoughts are about if Processwire will be superseded by another cms/cmf system in the future, this is also very unlikely. The vast majority of Processwire users came from other cms/cmf systems they where using before. It is because of being frustrated with the ruled limited ways of other cms/cmf systems they ended up with Processwire. This in it self is another indicator that Processwire will be there in the future.1 point
-
Hi @MarcV and welcome to the forums! A few comments. It's not a good idea to overwrite the $page variable because then the current page will refer to the page with ID#1004. Most of us use $p when referencing another page. You are not saving the page, so the changes are not sticking, but then you probably don't want them to stick because then they would affect all users. Can't you simply add a conditional at the top of template file for page#1004 that says to throw a 404 (throw new Wire404Exception();) if the page id is 1004 and the user's hostname is xxxxx? Does that help?1 point
-
Don't use any script or structure from softacolous. All you need is the webspace from your hoster. Make sure you delete any welcome html/ php file and scripts from your hoster. If you see any default .htaccess file open it first to see any hosting restrictions/configurations from their side. Then delete the .htaccess file also. So when you have empty webspace then upload the processwire files and install processwire. If this is not what it is about in your case then post some more information to help you out.1 point
-
https://processwire.com/docs/tutorials/how-to-structure-your-template-files/page3 https://processwire.com/api/templates/1 point
-
I think it is safe to say, that this thread was a simple way to seek attention and can be deleted.1 point
-
1 point
-
The faker api is also really nice to generate dummy data. See the "hosted microservice" section in the readme: https://github.com/marak/faker.js1 point
-
Not sure your exact needs, but this module might also be of use: http://modules.processwire.com/modules/fieldtype-select-ext-option/ - it allows you to generate a dropdown/radio/checkboxes etc from an external database table.1 point
-
Thanks tpr! A workaround is to add a pagetable field to the template. There you can add/edit/remove children if you want and its not necessary to let the children tab be visible. Disadvantage: it opens the child in another modal (modal in modal) - but it works. Best regards1 point
-
Are you using "includes"? Have you, for example, put this part in the header?: <html> <head> <title><?php echo $page->title; ?></title> </head> <body> And this part in the footer?: </body> </html> Please give more details about your approach, your structure(, the profile you use as a basis), etc.1 point
-
Hey guys, I know this isn't really a how to, but I am currently working on a system to inline above the fold css and was needing a json pagelist, and figured I would write something to automate it. I included the ability to flatten the tree or keep it expanded. There is also a filter section where you can exclude individual pages by path, parent, id, or template. This is all pretty bare bones and will pretty much just gives you a json array of your page paths, but that is all I needed. This is working code but you will need to clear out the filters for your own site. <?php /* * JSON SITEMAP GENERATOR * By Sam Fleming -- MUCHDEV * This will create a json sitemap for grunt or other purposes * * option includes flat / expanded. Use however you need * * apply whatever filters you need to exclude in the filter array * curently supports excluding by: * Path * Parrent * ID * Template */ ########################################################### ## SET HERE IF YOU WANT AN EXPANDED OR FLATTENED SITEMAP ## ########################################################### $flatten = true; ########################################################### ## YOUR PAGE FILTERS GO HERE ## ########################################################### $filters = array( "paths" => array( "/processwire/" ), "parents" => array( "3211", "5", "55", "98745" ), "ids" => array( "1123", "5985", "321454", "15885", "321115", "39" ), "templates" => array( "template1", "template2" ) ); function buildSitemap($flatten) { $home = wire('pages')->get('/'); $urls[] = $home->httpUrl; $urls[] = getChildren($home->children); if($flatten){ $flatArray = arrayFlatten($urls); return json_encode($flatArray); }else{ return json_encode($urls); } } function getChildren($pages){ foreach($pages as $page){ //iterate through all the filters in array, and if the type matches then set flag to true $flag = false; foreach($filters as $filter){ switch($filter){ case "paths": foreach($filter as $path){ if($page->path == $path) $flag = true; } break; case "parents": foreach($filter as $parrent){ if($page->parrent == $parrent)$flag = true; } break; case "ids": foreach($filter as $id){ if($page->id == $id)$flag = true; } break; case "templates": foreach($filter as $template){ if($page->template == $template)$flag = true; } break; } } if(!$flag) $urls[] = $page->httpUrl; //if page has children then recurse if($page->numChildren){ $urls[] = getChildren($page->children); } } return $urls; } function arrayFlatten($array) { $return = array(); foreach ($array as $key => $value) { if (is_array($value)){ $return = array_merge($return, arrayFlatten($value)); } else { $return[$key] = $value; } } return $return; } echo buildSitemap($flatten); ?>1 point
-
The Title field should already be on the template you are trying to add fields to (that's why it's greyed out).1 point
-
Go to site\modules\InputfieldCKEditor\config.js and open config.js in your editor. This will stop CKeditor from putting the <p> tag including the start and stop (global) <p> tag : CKEDITOR.editorConfig = function( config ) { config.enterMode = 2; }; And this will give you both the <p> and <br> tag when needed but does not prevent the start and stop <p> tag CKEDITOR.editorConfig = function( config ) { config.enterMode = CKEDITOR.ENTER_BR // pressing the ENTER Key puts the <br/> tag config.shiftEnterMode = CKEDITOR.ENTER_P; //pressing the SHIFT + ENTER Keys puts the <p> tag }; ======================== Tested with processwire 2.6.11 point
-
No need for ORM. Processwire's way is to build your Model using Pages and Templates.1 point
-
Guys, finally the podcast episode where I talk about PW is out. It's spoken in Portuguese, so most of you won't understand a word, but still I wanted to shout it here http://10web.pt/programas/programa-15-diogo-oliveira-trabalho-remoto-e-internacional-processwire-e-webdesign/1 point
-
You got it... You could think that it's a row in the database but that's not the case. (Dive in MySQL to find out) Every field is stored separately with the ID of the page. So ProcessWire makes joins (indexed) to give you all the data back what you're asking ProcessWire. So Loading a page and calling the title will only load the title, leaving the other fields alone... ..... silly me... Welcome Nanook !1 point
-
I took a serious try at Vagrant. Really, I did. Spent a week trying its various plugins, hostupdater and some other useful ones I read about. In the end, it just complicated my workflow. I have as many as 8 localhost sites in various stages on my machine. I use only two hosts (nearlyfreespeech and digitalocean). I develop on Debian. Git repos for all projects currently saved to bitbucket but soon may be moving to gitlab I really did not want a new instance of vagrant running for each project, costing me several gigs of space. Otherwise, I totally loved the experience. I think it's a pretty amazing concept! I went with Scotch Box and liked having everything set up1 point
-
I just want to quickly add: If posting the url to this forum is the seo strategy and we won't hear back from you I'm going to remove the link in the entry posting.1 point