Leaderboard
Popular Content
Showing content with the highest reputation on 11/09/2012 in all areas
-
This is turning into a different discussion, but I don't really care which WYSIWYG editor I use - they all suck, they just suck in different ways. At the end of the day, WYSIWYG (for most clients) is just not a good idea in the first place - clients are notorious for messing up designs, pasting bad markup, pasting from Word, picking colors that don't fit the design, and so on and so forth. Most WYSIWYG editors go to great extents to try to suppress and clean bad/faulty markup, and succeed to varying degrees, with varying degrees of negative impact on those of us who do know HTML. I have long been thinking about a new kind of WYSIWYG editor based on structured snippets, rather than raw markup. I believe it is possible to provide a WYSIWYG experience, giving the client the freedom they need, without giving them the power to mess things up - while at the same time, actually providing them with something that is faster, easier and more comfortable to work with. I have been coming back to this idea now and then for at least five years. Anyway, I'm going completely off-topic here...3 points
-
I’ve been working on a simple admin theme. I originally just wanted to add a simple dashboard area on the home page to display some quick links to key actions and documentation for clients, but I ended up doing a whole theme. The main focus of the theme is for the client / editor role, so it’s not been optimised for the developer usage yet. There are a few enhancements which are aimed at clients (opening previews in a new window, showing tree actions on hover). I have also tried to optimise it for mobile layout. You can see a preview on this video It’s using the Bootstrap framework and Open Sans font. The main issues I currently have are a conflict with the Bootstrap framework scripts and the older version of Jquery that ships with the PW admin. If I upgrade to Jquery 1.8.2 a lot of PW admin functionality breaks (sorting, ask select, modals). If I stick with the currently shipped version of jQuery 1.6, the bootstrap scripts do not work (drop downs, message alerts, mobile navigation). The other big issue, is I made a few simple hacks to some core js files (/wire/modules/Process/ProcessPageList/ProcessPageList.js, and /wire/modules/Jquery/JqueryWireTabs/JqueryWireTabs.js) - this was mainly to insert extra css classes here and there or to show if the tree has children. Is there a better way to do this? Other issues I am thinking about Is there a way to modify the “add new page” workflow? So when the user adds a new page, I’d like to change the default “You are adding a page using the …” message. Maybe this could be an additionally template field called “instructions” or “”details” ? It could be a used as a kind of “templates documentation”, which could be used to document the project for other devs and designers and for the clients / editors. How can you modify the login screen without overriding this file (/wire/modules/Process/ProcessLogin/ProcessLogin.module)? Also not to sure if having two save buttons is good for usability - maybe I will just have one in the header and make it fixed as you scroll.2 points
-
Just wanted to say that with the speed (and quality) of module development lately by the community and with the addition of Ryan's Form Builder (and a few profiles on the way) I really feel like there is less and less need to consider alternatives to PW for most projects. I'm so happy with the way things are moving, the API has always been so strong and gradually some quality additions are appearing that are just going to take this system to the next level. Once again, a big thanks to Ryan (+Apeisa, Soma, Diogo, Pete, Nico, Wanze and so many others) for all your continuing hard work! I'm excited by where PW will be in 12 months time!2 points
-
The white space thing can be solved like this .PageList .PageListItemOpen > ul.PageListActions, .PageListItem:hover > ul.PageListActions, /* <-- add this line! */ .PageListSelectHeader .PageListActions { display: inline !important; } .PageListItem{ display: inline !important; } .PageListItem:after { content:"\A"; white-space:pre; } not pretty but it works. edit: .PageListItem can go up of course, kept it separate for illustration purposes2 points
-
Perhaps even better: /** * Select random pages from a PageArray * * If no $seed is provided, today's date is used to seed the random number * generator, so you can use this function to rotate items on a daily basis. * * @param PageArray $pages the list of Page object to select from * @param int $amount the amount of items to extract from the given list * @param int|string $seed a number used to see the random number generator; or a string compatible with date() */ public function randomPages(PageArray $pages, $amount=1, $seed='Ymd') { if (is_string($seed)) { $seed = crc32(date($seed)); } srand($seed); $keys = $pages->getKeys(); $selected = new PageArray(); while (count($keys) > 0 && count($selected) < $amount) { $index = rand(0, count($keys)-1); $key = $keys[$index]; $selected->add($pages[$key]); array_splice($keys, $index, 1); } return $selected; } Now you can seed with a date()-compatible string, so you can rotate weekly (for example) using "YW", or monthly using "Ym", etc.2 points
-
I've been working on a blog profile that we can have as an installation option for ProcessWire. The goal is to have a profile that someone could download and setup a pretty nice website/blog without having to touch any code (i.e. it's ready-to-run and populate). I'm hoping that this is something that may help us to grow our audience beyond the web development community. The requirement is that it must be as easy (or easier) than WordPress, both to install and use. This profile is also for web developers, as it's a blog profile ready to be styled and enhanced -- a good starting point. It uses the Zurb Foundation CSS framework, so it is fully responsive and mobile-ready. It's not much to look at now, but should be fully functional. I'm making progress and wanted to post a preview. The content you see here is from one of my client's blogs and the content is just here to test things out. http://processwire.com/blogtest/ I'm hoping to get this up on GitHub next week. I've never really done much blogging, so am seeking feedback on what others would suggest to make the blog profile as good, powerful and simple as it can be. Right now it's pretty much a generic Zurb Foundation "look and feel", so it probably needs at least some color tweaks and integration of some masthead photo(s) or something.1 point
-
Lets see if we can get a quick-start tutorial going here. We'll start with something really simple and then work up from there. Tell me when something makes sense and when it doesn't and we'll adjust as we go. My thought is that we'd make a tutorial that plays on the 'hello world' phrase and lists information about planets in the solar system, starting with Earth. To keep it simple, we'll assume that the basic site profile is installed, as that's what comes with ProcessWire (so there's no need to uninstall anything). But we won't start using any of it's files tat this stage. Instead, we'll start out by creating our own files. STEP 1 – Create a template file Create a new file called: /site/templates/planet.php, and copy+paste the following HTML into that file: <html> <head> <title>Earth</title> </head> <body> <h1>Earth</h1> <h2>Type: Happy planet, Age: Millions of years</h2> <p>Earth (or the Earth) is the third planet from the Sun, and the densest and fifth-largest of the eight planets in the Solar System. It is also the largest of the Solar System's four terrestrial planets. It is sometimes referred to as the World, the Blue Planet, or by its Latin name, Terra.</p> </body> </html> The above is just a plain HTML file with nothing specific to ProcessWire. We will use this as the starting point for our template, and we'll go back and modify it later. STEP 2 – Add a template to ProcessWire Login to ProcessWire admin and go to Setup > Templates. This page shows a list of templates currently in the system. Click the Add New Template button. On the next screen that appears, you'll see it found your "planet" template file. Check the box next to the planet template and click Add Template. You may ignore any other options that appear on this screen. STEP 3 – Creating a page using your template Your planet template is now in the system and ready to use, but it's not being used by any pages. So lets create a page that uses the planet template. In the ProcessWire admin, click Pages in the top navigation. This is a site map if your page structure. We want to create a new page under the homepage, so click the new link that appears to the right of the home page. The next screen has 3 inputs: title, name and template. Enter "Earth" for the title, and the name should populate automatically. For the template, select planet. Then click Save. Now you have created a new page using the template that you added. You are now in the page edit screen and you should see your title field populated with "Earth". Click the View link that appears on this page edit screen. You should see the output of the HTML from step 1. Click the back button in your browser to return to the edit screen. STEP 4 – Creating a new field Now you know how to create a template and a page using that template. You could create more pages using the same template if you wanted to. But that wouldn't be particularly useful – this template file is just a static HTML file. Lets make it dynamic by creating some fields and adding them to it. We are going to create 3 fields to represent the pieces of data that currently appear in our static template. These include the planet's type, age in years, and a brief summary. We will call these fields: planet_type, planet_age and planet_summary. In ProcessWire admin, click Setup > Fields. This screen shows a list of fields currently in the system, most of which are general purpose fields for the basic profile. For the purposes of this tutorial, we are going to ignore those and create our own. Click the Add New Field button. On the next screen, enter "planet_type" for the Name, select "text" as the Type, and enter "Planet Type" for the Label. Then click the Save Field button. Now that your field is saved, you are on the Field Edit screen. At this point, your field is created and ready to be added to your planet template. Optional: While editing your field, click the details tab where you'll see a select box for Text Formatters. Select "HTML Entity Encoder" – this ensures that characters like "<", ">" and "&" will be converted to HTML entities and not confused as HTML tags. While not required, it's a good practice for text fields like this. After you've done that, click the Save Field button. STEP 5 – Creating more new fields In step 4 we created the planet_type field. Now we want to create the planet_age and planet_summary fields. So in this step, you'll want to do the same thing for the remaining two fields: Create the planet_age field exactly like you created the planet_type field, but enter "Planet age in years" for the label. Create the planet_summary field exactly like you created the planet_type field, but chose "textarea" as the Type and enter "Planet summary" for the label. Note that a "textarea" field is just like a "text" field, except that it can contain multiple lines of text. STEP 6 – Adding new fields to your template Now that you've created 3 new fields, you need to add them to your planet template. In ProcessWire admin, click Setup > Templates > planet. You are now editing your planet template. In the Fields select box, choose planet_type, then planet_age, then planet_summary. You will see each added to the list. Cick the Save Template button. STEP 7 – Editing a page using your template Now that you have new fields added to your template, go back and edit the Earth page you created earlier and populate the new fields that are on it. In ProcessWire admin, click Pages at the top, then click the Earth page, and click the edit button that appears to the right of it. You are now editing the Earth page you created earlier. You should see the new fields you added, waiting for text. Enter "Terrestrial planet" for Planet Type Enter "4.54 billion" for Planet Age in Years Paste in the text below for Planet Summary and then click Save. STEP 8 – Outputting dynamic data in your template file While still in the page editor from step 7, click the "View" link to see your page. Note that it still says "Happy planet" for type (rather than "Terrestrial planet") and "Millions of years" rather than "4.54 billion years". That's because the page is still being rendered with just the static data in it. We need to update the template file so that it recognizes the fields we added and outputs the values of those fields. Edit /site/templates/planet.php and replace the static text in there with tags like this, replacing field_name with the name of the field: <?php echo $page->field_name; ?> If supported by your server, you may also use this shorter format which some people find easier to look at and faster to enter: <?=$page->field_name?> Here is the /site/templates/planet.php file updated to output the content of the page using tags like the above: <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> After making these changes, save your planet.php template file. Now view your Earth page again. You should see it properly outputting all of the content you entered on the page, including "Terrestrial planet" for Type and "4.54 billion years" for age. Any changes you make from this point forward should be reflected in the output. STEP 9 – Creating more pages, reusing your template For this last step, we'll create another page (for Jupiter) using the same template just to demonstrate how a template may be reused. In ProcessWire Admin, click Pages and then click the new link to the right of the home page. Enter "Jupiter" as the Title and select "planet" for the Template. Click Save. Now that you are editing the Jupiter page, enter "Gas giant" for Type, enter "4.5 billion" for Age in Years, and copy+paste the following for Planet Summary: Click the Publish button and then View the page. You should now see your planet template being used to output the information for Jupiter rather than Earth. CONCLUSION In the above, we covered the basics of how to develop in ProcessWire, including the following: Creating templates and their associated template files Creating basic text fields and adding them to templates Creating and editing pages that use your templates Outputting the values of fields in template files If all of this makes sense so far, I thought we'd follow up next with a tutorial to take this further: Adding and outputting photos for each planet Creating navigation that lists all the other planets that have pages in the system …and we'd keep building upon the tutorial from there. If you all think this tutorial is helpful, then perhaps this can be a draft for a real tutorial we'll put on the site, so all of your help is appreciated in making this as good as it can be.1 point
-
Duh, it was turned off! ... it's hard to see on the icon in the client that it's even possible to turn it on/off ... man, I'm having a slow day1 point
-
I don't see any reason to add more settings that are totally irrelevant or purely aesthetic for 99% of projects. Urls with trailing slashes look nicer (imo) and work nicer (like Ryan explained). Overthinking and overconfiguring each possible option is certain way to bloat. Page that isn't allowed to have sub-pages might be allowed to have sub-pages later on. Also the family tab settings are only for admin usage - children are possible through API. So I wouldn't tie any code breaking functionality on that setting and assumption.1 point
-
Take out the "Inputfield" part, and it describes what the field is. For instance "Form" is a <form> and "Text" is an <input type="text"> You want to use the InputfieldSelect included with ProcessWire: $select = $modules->get('InputfieldSelect'); $select->name = 'my-select-field'; $select->addOption('A', 'Option A'); $select->addOption('B', 'Option B'); $select->addOption('C', 'Option C'); $select->value = 'B'; // if you want to set a predefined value $form->add($select);1 point
-
Keep in mind that ProcessWire can run in shell scripts outside of Apache/http. But so long as you aren't dealing with timeout issues, it should also be fine to trigger it the way you are asking about too (whether curl or wget or something else). However, you'll want to make sure you've got some good security through obscurity (obscure URL), and/or a GET/POST variable pass key or something to ensure nobody else can trigger your script except you. This is always a concern with anything http accessible.1 point
-
you.try this <?php foreach ($blocks as $index => $block): ?> <?= $block->set('pagamos', $page)->render(); ?> <?php endforeach; ?> menu-black tamplate: <ul class="menu-block-links"> <?php foreach ($page->pages as $item): ?> <li<?= $page->pagamos->id === $item->id ? ' class="active"' : '' ?>><a href="<?= $item->url ?>"><?= $item->title ?></a></li> <?php endforeach; ?> </ul>1 point
-
Cheers Pete! Also noticed that I was getting repeat tweets, don't know if this is due to editing an existing file...1 point
-
I did it very quickly, and mostly because I was curious if it would be an easy task. It's not an easy task, but it's less difficult than I expected... lesson learned: we really don't have to be stuck to a editor if we don't want. Truth is that CKeditor future versions got me really curious. Just have a look at these examples: inline editor, placeholder, div replace all taken from here http://nightly-v4.ckeditor.com/3783/samples/ Would be also interesting to make a module for markItUp integration.1 point
-
Have had my site up for a while now and while it's pretty simple, I like simple! Am sure there's tons to be improved on but I'll be updating it quite often I'm sure! http://www.andregoldstein.co.uk1 point
-
Often I use the internal domain names ( in hosts file ) with the extension .local. Sites developing with that extension responds as it should in safari (mac). On Google Chrome however, the respond is very slow. It looks like Google wants to collect as much data posible and before the request is send to apache the data is send to mighty Google. Changing the extension from .local to .loc (in host file ) solves the lagging for me. Hopefully this post is helpful for people experience the same issue.1 point
-
These are just quick ideas off the top of my head about running at the same time every day. If you can add cron jobs to the server box, that's probably the best way to go. Try... Making the script executable by whatever user the webserver uses. From the server's command prompt setup the cronjob via "crontab -e". You will need to add a line to this file and you can use this cronjob calculator to help you set it up. However, if you have no access to cron on the server, install the lazycron module instead and then set up a cronjob on another internet connected box that is always on at 2am that uses wget to visit your site and hence trigger your script.1 point
-
1 point
-
The Processwire community is indeed very awesome. I wouldn't be as inclined to ask this kind of question any other place, but I know that here I would get reasonable and helpful suggestions. Processwire seems to attract these kind of respectful and helpful developers. I guess it's easy to help out when the system isn't driving you mad. I love the fact that the more I learn about web development in general, then better at Processwire I get, and vice versa. They go hand in hand, and that IMO is what makes a great CMS/CMF. Even your first starting profile is already helpful to me, saves me the time of ripping all the fields and templates out before I start a fresh project. Profiles with what you listed will be nothing short of amazing. I've been away from PW a bit, and am pretty excited to give 2.2 a whirl~ especially the user system. I hope that I can help out more in the future as I am now using it quite heavily in my business. I'm going to do a more in depth study of the php behind it before I start making modules or profiles. As I work through it, I think I may see stuff which could use further documentation. If I do, how could I help out with that?1 point
-
First of all, don't worry too much, you will normally find all the problems after launching Here are some of the things I try to do before launch : - Check the page titles and meta descriptions. Install the Google webmaster tools to get more useful advice on how to optimise the site for search engines https://www.google.c...ebmasters/tools - Create an xml site map and submit to Google (via Webmaster tools) and Bing (http://www.bing.com/toolbox/webmaster) - If this is the an update of an existing site, setup redirects for old pages to new pages - you can check what old links are currently indexed by Google and start with the top ones. The redirect plugin is great for managing this (http://modules.proce...cess-redirects/). - Check and update the 404 error page - Check that all your forms are working and being delivered to email recipients (not stuck in spam). - Change the admin url from /processwire/ to something more secure - Turn off any debug modes - Disable any test accounts and put an extra secure password on the master account. - Check what print layout looks like (or make print style sheet) - Browser testing - this is tough one to summarise - there are some sites that let you take screenshots, but the best way I have found is to have multiple virtual machines with IE7, IE8 and IE9 which can be used for more detailed testing and debugging. Then there is mobile device testing! - Check for broken links and correct redirects. http://validator.w3.org/checklink - Performance testing - you might want to check for any big performance issues. ySlow is a nice tool for checking and provides some good tips that might be useful for speeding up the site. Don't be too disheartened by the results, not even the big sites get top marks. http://developer.yahoo.com/yslow/ - Setup analytics to track usage - Google analytics - Setup monitoring so you know the site is up and running - I really like pingdom.com - https://www.pingdom.com/ - Backup the site files and database! Then I like to say a little website launch prayer… "dear internet gods, I know things will go wrong but please let the issues be small and easy to fix. amen."1 point
-
I've just found this while searching for something else... Maybe it would come handy to someone... http://tinymce.swis.nl/1 point
-
OK, after lots of research, this video has made my mind up for me Think the PW community needs to hire him1 point