Leaderboard
Popular Content
Showing content with the highest reputation on 08/02/2013 in all areas
-
More and more, processwire has become my personal haven... I do almost no commercial work with it (I work as a dev, and for payed side-projects I suffer the dread of joomla droppings ) Made this "thing": - http://www.lisboncorrespondent.com/ This is a blog (of sorts) for my father, with make-pretend postcards sent from Portugal. It is essentially a way for me to experiment with and learn a few techs/tools: css 3d transforms (and respective headaches, cross-browser issues, etc) The wonderful angularJS framework Yeoman (build system for js apps, with grunt + bower) Processwire, of course Processwire is amazing for every crazy thing I may ever think up, and using it as a simple RESTy service provider is incredibly simple. Gotchas: This will most likely be a perma-beta site - it is for trying stuff No history back/forward or direct urls - angularJS makes it easy, but it wasn't really my concern. Will have to happen someday, though No SEO whatsoever - I'm perfectly aware that a "blog" in a one page app is a no-no, but again, just toying around Tested with Chrome, Firefox and IE 10, OSX and Win - further compatibility (and mobile) to come Hope you enjoy. And thank you, Ryan, for the wonderful gift of processwire5 points
-
5 points
-
Images are stored in /site/assets/files/1234/ where 1234 = id of the page containing that/those image(s) .. The reference to the image (the image name, e.g. myimage.png) is stored in the database in a table which bears the image field name. E.g. if you created an image field in PW called photos, in the DB it will be named field_photos. That is where the image(s) name will be stored...The names and other data are stored as rows in that table. Hence, if you created an image field that can only hold 1 image, you will only see I row in the respective table. If you have an image field for multiple images, you will see multiple rows. The columns in the table help identify what image belongs to what page. The columns are: pages_id: (whose image is this column . This will be equivalent to the name of the folder in /site/assets/files/1234. In this case pages_id=1234) data: name of the image sort: sort order of the images; only useful when there's multiple images of course description: self explanatory modified: ditto created: ditto So how does PW know what type a field is? That information is stored in the table fields for each and every field in your site. If this sort of thing interests you, have a look in the PW database using phpMyAdmin or similar... . It will help you better understand the PW DB schema and the genius that it is..simple but effective. As for image compression, I only have limited knowledge about that at present so can't answer definitively...5 points
-
I've recently updated my website. This is the first site I've made in it – although I have one other that's in progress (which unfortunately may never be used) – and compared to the process of making a site in something like Wordpress it was far simpler and quicker, and is much cleaner, easier and streamlined for updating, etc. It's a fairly simple site made with Twitter Bootstrap, Masonry.js and making use of the Dribbble API, with the aim of letting the images do the talking.3 points
-
Ok, as I thought, this code is the problem $thisCategory = wire("page")->name; if($thisCategory !="news") { $category = "news_categories_01.name=" . $thisCategory; } When you click a category in the list, the page is not called "news" anymore, so the $category variable is not set. That's why it's missing. You have to adapt the code so that the categories pages are also included on that if check. -- On your second problem: wire("page") holds the current page being viewed, so when you use it on the homepage, that's the page that will be called by it, and not "news" as you want. To correct this, you will have to change wire("page") by wire("pages")->get(1234), where 1234 would be the id of the "news page". That will work everywhere. I'm not sure why you are using wire() in this code, but in case this is not a conscient decision, just wanted to clarify that wire('page') is the same as $page, and wire('pages') is the same as $pages.2 points
-
I've built a prototype page builder using Hanna codes. I create Hanna codes for different types of content blocks that you might want to display inline, inside of a RTE field. Don't forget that you can pass attributes to your Hanna code, which can be PHP and have full access to the PW API. In my example, I might have "Products" template with a bunch of categorized products, and I could set up a Hanna code called "product_list". The Hanna code accepts a parameter called 'filter' which is used as part of a PW selector in the product_list's Hanna PHP definition. This filters the products to display. Then a content editor could create something like this inside the RTE: Tortor Tristique Donec sed odio dui. Donec sed odio dui. Sed posuere consectetur est at lobortis. Etiam porta sem malesuada magna mollis euismod. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Nullam quis risus eget urna mollis ornare vel eu leo. [[product_list filter="color=blue,category=t-shirt,limit=5" ]] Vestibulum id ligula porta felis euismod semper. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas faucibus mollis interdum. Aenean lacinia bibendum nulla sed consectetur. Etiam porta sem malesuada magna mollis euismod. Donec id elit non mi porta gravida at eget metus. [[product_list filter="color=red,category=hat,limit=5" ]] Donec ullamcorper nulla non metus auctor fringilla. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Nullam quis risus eget urna mollis ornare vel eu leo. You can get very creative with this approach. For example you could also add a parameter to your hanna code called 'display' which accepts "ul" or "ol" to change the type of HTML list the Hanna code would output. Or maybe it shows just linked product titles by default but you want the option to show a short description with each title, you could can add a detail parameter of y/n to display the appropriate level of detail for a particular list. The possibilities are endless. I also recommend providing brief help text in the RTE to let editors now what Hanna codes are available, and what the acceptable parameters are. It's pretty amazing, really.2 points
-
Check if the field is filed before outputting the tags. Here's one way of doing it: // create a variable for each field that includes the html tags only if the field is populated $link_text_01 = $banner->link_text_01 ? "<a href='{$banner->link_01}' target='_blank'>{$banner->link_text_01}</a>" : ""; // inside the echo replace the entire element by the variable2 points
-
Glad you found a solution. By chance, do the links from the slider images go to other pages on your site? Maybe they don't, but if by chance that is the case the approach I use is a single image field in the template for the pages you want to link to. Then you can do something like: $out .= ' <ul class="slideshow">'; foreach($pages->find('template=basic-page|another-template, slider_image!='', limit=4') as $slider){ $out .= '<a href="'.$slider->path.'"><li><img src="'.$slider->slider_image->url.'" /></li></a>'; } $out .= ' </ul>';2 points
-
Or even... $pages->find("template=event, has_parent!=2, status=unpublished"); http://processwire.com/api/selectors/#access_control2 points
-
A good way is to use more specific selector. 2 is parent ID of admin pages, and it will only return unpublished pages. $pages->find("template=event, has_parent!=2, status>=" . Page::statusUnpublished);2 points
-
Easily insert any complex HTML, Javascript or PHP output in your ProcessWire content by creating your own Hanna code tags. This module is based loosely on the WordPress Hana Code Insert plugin. A Hanna code tag looks like [[hello_world]]. A Hanna code tag with attributes looks like [[hello_world foo=bar" bar="foo]] using HTML style attributes or [[hello_world foo=bar, bar=foo]] using ProcessWire selector style attributes. After installing the module, you define your Hanna codes in Setup > Hanna Code. These Hanna codes that you define can then be entered within your body copy (or other text where you allow) and they will be replaced with the values defined or generated by your Hanna code. A common use case is to embed scripts or other bits of HTML or codes that would usually be stripped out by an editor like TinyMCE. However, Hanna codes can be more than just static snippets--they can be dynamic PHP or Javascript that outputs different things according to the request. PHP-based Hanna codes have access to the entire ProcessWire API. Hanna code accepts named attributes in the tag that can be passed as variables to PHP and Javascript Hanna codes. These attributes can be specified either in HTML attribute format or ProcessWire selector format. In either case, quotes should be used around the attribute value when the value contains whitespace or a comma. How to install Place the module files in /site/modules/TextformatterHannaCode/ In your admin, click Modules > Check for new modules Click install for TextformatterHannaCode Now to go Setup > Fields and locate the Textarea field(s) that you want to use Hanna codes with ("body" for instance). When editing the field, click the details tab, and select "Hanna Code" as the Textformatter. Save. Now go to Setup > Hanna Code and start defining your Hanna Codes! You may want to use one of the examples from this document to get started. Tag format Below is a Hanna code tag named hello_world with no attributes. If you pasted this into your body copy, you would get whatever the replacement value is that you defined. [[hello_world]] Below is a Hanna code tag named hello_world being passed attributes of foo, bar and foobar. If this were a PHP-based Hanna code, it would receive the variables $foo, $bar and $foobar: [[hello_world foo="bar" bar="foo" foobar="foo bar"]] Below is the same Hanna code tag as above, but with attributes more like ProcessWire selectors. You can use whatever format you prefer. Just note that unlike regular ProcessWire selectors, quotes (single or double) are required around any value that has whitespace. [[hello_world, foo=bar, bar=foo, foobar="foo bar"]] How to use Please make sure that you have completed the How to install section first. Then in your admin, go to Setup > Hanna Codes. Each Hanna code that you add has a type of either: Text/HTML, Javascript or PHP. The Text/HTML type is literally self explanatory in that your [[custom-tag]] is replaced with exactly the text you paste in. Anywhere that you type your [[custom-tag]] in your body copy will be replaced with exactly the static text you defined. More power opens up with the Javascript and/or PHP types of codes. These codes execute at runtime and thus can contain specific logic to produce different results. In fact, PHP Hanna codes have access to the entire ProcessWire API and are executed in the same manner as template files. Your PHP-based Hanna code should simply "echo" or "print" the replacement value. PHP example Create a new Hanna code with the name "children". Select "PHP" as the type. Paste in the following for the code: foreach($page->children as $child) { echo "<p><a href='$child->url'>$child->title</a>"; } Now go and edit a page that has children. In the body copy, enter [[children]] in the place where you want the output to appear. View the page, and you should see the rendered list of links to children. PHP example, part 2 Now lets take the above example further... Go back and edit your "children" Hanna code, as we are going to modify it to respond to a "parent" attribute. Change the code to this: if(isset($parent)) { // If $parent is an ID or path, lets convert it to a Page $parent = $pages->get($parent); } else { // otherwise lets assume the current page is the parent $parent = $page; } foreach($parent->children as $child) { echo "<p><a href='$child->url'>$child->title</a>"; } Go back and edit the page where you previously inserted the [[children]] tag, and change it to: [[children, parent=1]] (specifying the homepage) or [[children, parent=/path/to/some/parent/]] if you want to try something else. View the page and you should now see it showing the children of the homepage (or of another parent you specified). Please see the Javascript and PHP usage notes on the Hanna code entry screen. Security There are major security implications with a tool that will let you enter unfiltered text and code from your web browser. As a result, Hanna codes are meant for definition only by superusers and we recommend keeping it that way. Download Download the Hanna Code module from the ProcessWire modules page or from GitHub.1 point
-
See screenshot for a better understanding of my question: I have lots of generic field names per template (the generic naming is for scalability/simplicity reasons and necessary), so it would be nice to have the field label show up besides the field name for better overview. Is this possible? The status quo is ok-ish, but the field label showing up would be neat, faster and save me some clicks.1 point
-
That would technicaly work and provide a good level of flexibility. I wonder how the average editor would come to terms with it, though. Thinking of it diogo's solution might really be the best way to imitate the "content element model". That's what I was guessing, too. I read somewhere that repeaters are not the best in terms of performance either.Hanna code looks very powerful indeed. Definitely something to check out! Would be great to have a non-cryptic implementation for the technically challenged end users. Like a drag and drop way... That's beyond my modest skills, though... I will definitely give PW a try if I have a project that fits. There are scenarios where Contao doesn't give you the powerful tools to enter and retrieve data in a very streamlined and customized way (out of the box at least, there are extensions though that do exactly that.) That's where PW seems to really shine. It does seem to come at the cost that the resulting pages should be highly standardized and follow a pre-defined "cookie cutter design" (well, that's what a template really is) - or much tweaking and workarounds are necessary. At least that's my impression so far. After all PW is meant to be a CMS not a site builder, I understand that.1 point
-
I looked a bit better at the whole code (i confess I didn't before...). The wire() method is needed because the code is inside a function (variables, like $page, don't work inside functions but methods, like wire() do http://php.net/manual/en/language.variables.scope.php). So keep it as it is. I don't have time to look at the tutorial and understand the problem with $category. What you can do for now to get rid of the error, is define the variable before that if check: $category = "";1 point
-
1 point
-
Very nice Tiago!! Two suggestions: 1. You could show how many postcards are in the July tab by simply counting them (count()) and rendering their top (no need to load the text), because now it seems that it's empty. 2. When I turn the postcard I can see for a moment the paper in white because the image starts loading only then. I would start loading it as soon as you show the front.1 point
-
Ohhhh, that's a nice solution! My slider images do in fact go to other pages on my site, which are photo albums. I may switch to this method.1 point
-
Hi nfil, Don't know whether I've said welcome to PW or not. If not, welcome . Are you allowing multiple or single file uploads on that field? If single... if ($page->pdf_docs_insert){ $myfile = $page->pdf_docs_insert; echo "<a href='{$myfile->url}' target='_blank'>$myfile->description</a>"; } else { // ... } If multiple files, the field returns an array, hence you need to loop through it... if ($page->pdf_docs_insert){ $myfiles = $page->pdf_docs_insert; foreach ($myfiles as $myfile) { echo "<a href='{$myfile->url}' target='_blank'>$myfile->description</a>"; } } else { // ...please give me some files mate! } Check out the cheatsheet for more info1 point
-
What I used here was a ternary operator, that in this case works as an else/if clause. Check an explanation here http://robertsettle.com/2012/07/php-shorthand-if-statements/ Soon, you will be knowing PHP without even noticing1 point
-
1 point
-
Oh man, that is so great and simple, worked just like I wanted when implemented on all items! Thanks a ton - and sorry for not knowing even basic php! Starting to love this framework even without that knowledge though and your help is awesome.1 point
-
filter() alters the pageArray for good. Do this instead: $stuff = $page->all_list; $stuff2 = $stuff->find('parent.name!=thing');1 point
-
Hi Uliverse, I'm a long time Contao user too and I'm afraid you can't mimic the same behavior as in Contao. The above described ways are workarounds but not the same. In PW you have to be much more clear about your article structure from the very beginning. The advantage is that you have much more control over your markup. In Contao there are many if-than situations you can't foresee and thus not control. This applies mainly to site styling, e.g.a headline may be inserted inline or as a content element resulting in two different markup situations. Give PW a try. It is much more flexible in its own way than Contao. EDIT: This is possible, but repeaters are sticked as "fields" to their template. Let's say you'll have three different kinds of repeaters each of which with another order of fields or different fieldtypes at all and you want your editor to be able to choose from each of the three options on any page. In this case you'll have to attach all three repeaters to any template edtiors may use. Anyway, the described scenario is the one that comes closest to Contao. At least, as far as my understanding reaches.1 point
-
You can add that flexibility with a little logic in your templates. Say you add 2 checkboxes, Display Album & Render Children. Then on the template you check if "Display Album" is true and count the images. If there are to less or none just display a photo or do nothing. When there are more then x items display an album. Same goes for child pages. If you want it in between your page body, you can use php's str_replace. But I think the easiest way right now is using Hanna code A simple Album/Foto script for-example: modify it for your needs !HannaCode:album:eyJuYW1lIjoiYWxidW0iLCJ0eXBlIjoiNiIsImNvZGUiOiJcLypoY19hdHRyXG50YWc9XCJcIlxuaGNfYXR0cipcL1xuaWYoc3RybGVuKCR0YWcpKSB7XHJcblx0JGltYWdlcyA9ICRwYWdlLT5pbWFnZXMtPmZpbmRUYWcoJHRhZyk7XHJcblx0JGNvdW50ID0gY291bnQoJGltYWdlcyk7XHJcblx0XC9cLyBzaG93IHBob3Rvc1xyXG5cdGlmKCRjb3VudCA8IDMgJiYgJGNvdW50ICE9IDApIHtcclxuXHRcdGZvcmVhY2goJGltYWdlcyBhcyAkaW1hZ2UpIHtcclxuXHRcdFxyXG5cdFx0XHQkdGh1bWIgPSAkaW1hZ2UtPndpZHRoKDYwMCk7XHJcblx0XHRcclxuXHRcdFx0aWYoJGltYWdlLT53aWR0aCgpID4gNDAwKSB7XHJcblxyXG5cdFx0XHRcdGVjaG8gXCI8ZGl2IGNsYXNzPSdpbWFnZSBwaG90byc+XFxuXCI7XHJcblx0XHRcdFx0ZWNobyBcIlxcdDxhIGhyZWY9J3skaW1hZ2UtPnVybH0nIGRhdGEtZnJlc2NvLWNhcHRpb249J3skaW1hZ2UtPmRlc2NyaXB0aW9ufScgZGF0YS1mcmVzY28tZ3JvdXA9J3skcGFnZS0+bmFtZX0nPlxcblwiO1xyXG5cdFx0XHRcdGVjaG8gXCJcXHRcXHQ8aW1nIHNyYz0neyR0aHVtYi0+dXJsfScgXC8+XFxuXCI7XHJcblx0XHRcdFx0ZWNobyBcIlxcdDxcL2E+XFxuXCI7XHJcblx0XHRcdFx0ZWNobyBcIjxcL2Rpdj5cXG5cIjtcclxuXHRcdFx0fSBlbHNlIHtcclxuXHRcdFx0XHRlY2hvIFwiPGltZyBzcmM9J3skdGh1bWItPnVybH0nIGRlc2NyaXB0aW9uPSd7JGltYWdlLT5kZXNjcmlwdGlvbn0nIFwvPlwiO1xyXG5cdFx0XHR9XHJcblx0XHR9XHJcblx0XHRcL1wvIHNob3cgYWxidW1cclxuXHR9IGVsc2UgaWYoJGNvdW50ID49IDMpIHtcclxuXHRcdGVjaG8gXCI8dWwgY2xhc3M9J3RocmVlX3VwIHRpbGVzJz5cXG5cIjtcclxuXHRcdGZvcmVhY2goJGltYWdlcyBhcyAkaW1hZ2UpIHtcclxuXHRcdFx0JHRodW1iID0gJGltYWdlLT5zaXplKDIwMCwyMDApO1xyXG5cdFx0XHRlY2hvIFwiXFx0PGxpPlxcblwiO1xyXG5cdFx0XHRpZigkaW1hZ2UtPndpZHRoKCkgPiA0MDApIHtcclxuXHJcblx0XHRcdFx0ZWNobyBcIlxcdFxcdDxkaXYgY2xhc3M9J2ltYWdlIHBob3RvJz5cXHJcXG5cIjtcclxuXHRcdFx0XHRlY2hvIFwiXFx0XFx0XFx0PGEgaHJlZj0neyRpbWFnZS0+dXJsfScgZGF0YS1mcmVzY28tY2FwdGlvbj0neyRpbWFnZS0+ZGVzY3JpcHRpb259JyBkYXRhLWZyZXNjby1ncm91cD0neyRwYWdlLT5uYW1lfSc+XFxuXCI7XHJcblx0XHRcdFx0ZWNobyBcIlxcdFxcdFxcdFxcdDxpbWcgc3JjPSd7JHRodW1iLT51cmx9JyBkZXNjcmlwdGlvbj0nXCIgLiAkaW1hZ2UtPmRlc2NyaXB0aW9uIC4gXCInIFwvPlxcblwiO1xyXG5cdFx0XHRcdGVjaG8gXCJcXHRcXHRcXHQ8XC9hPlxcblwiO1xyXG5cdFx0XHRcdGVjaG8gXCJcXHRcXHQ8XC9kaXY+XFxuXCI7XHJcblx0XHRcdH0gZWxzZSB7XHJcblx0XHRcdFx0ZWNobyBcIjxpbWcgc3JjPSd7JHRodW1iLT51cmx9JyBkZXNjcmlwdGlvbj0neyRpbWFnZS0+ZGVzY3JpcHRpb259JyBcLz5cXG5cIjtcclxuXHRcdFx0fVxyXG5cdFx0XHRlY2hvIFwiXFx0PFwvbGk+XFxuXCI7XHJcblx0XHR9XHJcblx0XHRlY2hvIFwiPFwvdWw+XFxuXFxuXCI7XHJcblx0fVxyXG59In0=/!HannaCode1 point
-
I tend not to use functions but classes with static methods to organize code into contexts. In my config I place this code for example: function MZWHelpers($className) { $path = wire('config')->paths->root . 'site/templates/_classes/'; $file = $path . $className . ".php"; if(file_exists($file)) { include $file; } } spl_autoload_register('MZWHelpers', true); I can call them in my templates via: MZWHelpers::saySomething("hello"); The class gets automatically loaded and included in every template whenever I call methods of that class, so very convenient. If you add other classes to abstract/collect specific logic, you just add another autoload in the config for that class. Anyway, that's how I do it, perhaps there's a better way.1 point
-
Hi Everyone! I'm glad to show you guys my first Processwire project: http://www.ihera.com.br/ It's a simple yet tailor made website I did for a clinic specialized in women health in Brazil. We've designed/coded several templates for the backend, used the Skeleton CSS Framework (http://www.getskeleton.com/) to help making it responsive adn some some minor javascript to some pages - and of course, made it very SEO friendly with custom titles and meta description for each page. I'd like to thank Ryan again for this amazing tool! I've never done such a tailor made CMS (Wordpress, Joomla, Drupal, CMS - I've been there) that's so easy to use that my client didn't need more than 10 minutes of "training" and is super happy about the outcome and the ease of maintaining it. Simple, amazing and beautiful. Best of all: the code is clean and since you code the templates from scratch, you know exactly what is what and speed and great clean markup is an obvious result of it... Let me know what you think! Tks a lot! jw1 point
-
http://processwire.com/api/user-access/roles/ http://cheatsheet.processwire.com/#roles http://cheatsheet.processwire.com/#user where you see API also for checking permissions or roles (hasRole(), hasPermission()) http://processwire.com/api/variables/user/1 point
-
Well as you suggested, that is more of a challenge and I expect to do it nicely would require a module to add an additional field to the image. Ryan provides the code to do this here: http://processwire.com/talk/topic/417-extending-image-field/ A cheat's way out would be to use the description field, for both parts. This is very hackish, but will work. You could split the description field with a delimiter - maybe a pipe - eg: this is the description|http://link.tothe.image.com/ The you could use something like: $description_link = explode("|", $image->description); $description = $description_link[0]; $link = $description_link[1]; Depending on the client this might be too confusing for them to manage.1 point
-
You are welcome. It is never advisable to mess about with the core code. I believe a module (it is not hard to create a field type, for instance) can be used to add that functionality or there could be another way of doing it via API. I am too tired to think straight now but there will be better answers here soon I know Edit: In fact, I don't see why you can't use API in your template file to output a URL with a particular image...maybe a module is an overkill in this case. I can't think; I need to sleep hehe. Let's wait for the geniuses to answer this one1 point
-
Problem is that you search only published pages. Try adding include=all to your selector, this will also give you unpublished pages.1 point
-
Thanks, I understand now. I've updated the InputfieldCKEditor to populate the config.height property based on the rows value.1 point
-
Lets say you've got a structure like this: /posts/ /some-post/ /another-post/ ...and so on... /categories/ /plants/ /fish/ /birds/ Create a field called "categories" (or whatever you want to call it). On the "details" tab, make sure it says "Multiple pages - PageArray" for the type, which I think is the default. On the "input" tab, set the parent to be /categories/. Also on the "input" tab, choose "asmSelect" as the input field type (or if you prefer something other than asmSelect: checkboxes, select multiple or autocomplete). Add your "categories" field to your "post" template. Save. Now edit one of your pages below /posts/ and you should be able to select multiple categories. To output those categories on the front-end, you'd do this: <h3>Categories</h3> <ul><?php foreach($page->categories as $c) { echo "<li><a href='$c->url'>$c->title</a></li>"; } ?></ul>1 point
-
I was able to duplicate it too. Looks like it's a core issue when dealing with multi-value Fieldtypes that only have an array value (rather than an object value). These two modules (FieldtypeModules and FieldtypeTemplates) I think are the only two that would be affected. I've implemented a fix in the dev branch and will be testing it for a bit before committing.1 point
-
I am absolutely confident that if anyone actually had > 32,000 (ext3) or > 64,000 (ext4) pages with images or other files and came to the forum asking for help, Ryan or someone else here would have a solution available in a couple of days at most. At the moment however, that hasn't yet happened, so the problem is moot.1 point
-
Just today I relaunched http://barefigur.es/ It’s now powered by ProcessWire. A bit of history: I launched Bare Figures in January 2012. Originally it’s a site for visualizing Apple’s quarterly results. Charts are being rendered by Highcharts JS. In the first few months after the original release I did all manually (actually also creating the JSON file by hand). After that I used a bare-bones SQL database for inputting the data and a PHP script generated the JSON file to feed Highcharts. Now Bare Figures is powered by ProcessWire (and it feels just absolutely right, I love it). I created a module that generates the JSON files and now the site is, of course, also scalable, which means I can add more companies to the site (the first one besides Apple is Google). I plan to add many more in the future. What do you think?1 point
-
i think: wow! (and feel like an idiot because i didn't buy those google shares back in the early 2000 years ...).1 point
-
I will soon have to create a link list fieldtype, where you could add links with url and text, internal and external. I'm surprised nobody done that yet, as it seems a basic feature a CMS should have. I've used repeaters until now and it's ok I guess too, but maybe a dedicated fieldtype would be nice. Another option is to use a Wysiwyg field as that would already allow for "easy" creating a list of links. Those are all very easy to setup option and flexible. But you know it's fun to develop for PW. Or anyone want to have a go or know if this would make sense at all?1 point
-
@pwired - i'm sure everyone has a different approach to this. This is how i have approached the last few sites: 1.) in the admin, define fields and templates, and add content. I stay in the backend for a while (and don't bother making the actual php files for the templates). Once the backend is stable (data structure of fields and templates, page tree) and there is enough content then i will start to 'wire up' the front end. 2.) Separately design the frontend, using whatever tools you would usually use, optionally on whatever framework you prefer (foundation, bootstrap); sometimes this part can be as simple as using html5 kickstart, or as complex as going through wireframing process etc.. i like to work with a design that is close to finished before 'wiring' it. 3.) the wiring part is pretty easy; it's good to have a list of all your field names and templates...you can configure the files in various ways, have a look at some of the site profiles for examples of this...1 point
-
For what it's worth, I always put semicolons after even single lines, not so much in the case @pwired cites above, but in more general cases. Say I have this <?php $foo = "bar"; ?> and then I realise I need to add another line <?php $foo = "bar"; $baz = "qux"; ?> I don't need to remember to add a semicolon to the first line when editing to add the second line, because it's already there.1 point
-
From: http://php.net/manual/en/language.basic-syntax.instruction-separation.php1 point