Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 11/28/2013 in all areas

  1. This module serves as an example of creating an editable table of data as a Fieldtype and Inputfield in ProcessWire. In this case, we create a simple table of events each with date, location and notes. This pattern can be adapted to nearly any table of information. Note that this module is intended as a proof-of-concept. If you find it useful for the example scenario (events) then great, but keep in mind it is not intended as a comprehensive events solution, where using ProcessWire pages may be a better fit. This is a pattern I've used for creating tables of data in ProcessWire for many different Fieldtypes/Inputfields and thought it would be good to setup a proof-of-concept example like this to share. Module Page / GitHub Page Install Copy the files for this module to /site/modules/FieldtypeEvents/ In admin: Modules > Check for new modules. Install Fieldtype > Events. Create a new field of type Events, and name it whatever you would like. In our examples we named it simply "events". Add the field to a template and edit a page using that template. Output A typical output case for this module would work like this: foreach($page->events as $event) { echo " <p> Date: $event->date<br /> Location: $event->location<br /> Notes: $event->notes </p> "; } This module provides a default rendering capability as well, so that you can also do this (below) and get about the same result as above: echo $page->events; ...or this: foreach($page->events as $event) { echo $event; } Finding events This fieldtype includes an indexed date field so that you can locate events by date or within a date range. // find all pages that have expired events $results = $pages->find("events.date<" . time()); // find all pages with events in January, 2014 $results = $pages->find("events.date>=2014-01-01, events.date<2014-02-01");
    4 points
  2. Hi I recently finished my first ProcessWire website, and it's a gallery of black and white vintage erotica. Here's what I used: Default ProcessWire Installation. Bootstrap, jQuery (for the bootstrap carousel and MediaElement.js), MediaElement.js and Glyphicons (they come with Bootstrap.) Photos are sharing two templates (one is for single photo entries, and the other is for multiple photo entries and it uses Bootstrap's carousel.), Featurettes have their own template and there is only one. I also have a simple tagging system. It didn't really take me a while to figure ProcessWire out, it really was a piece of cake for someone without a lot of PHP knowledge. I had way more trouble getting a hang of WordPress than ProcessWire. It's a great piece of software. Before I forget, http://faysjoint.com Fay
    4 points
  3. Greetings, Hey, I thought your avatar looked familiar! Of course... gerhard! Welcome to another former Joomla guy. Even better, a former Seblod guy! There are a few of us here. Some links that might be of interest to you: http://processwire.com/talk/topic/4844-joomla-vs-pw/ http://processwire.com/talk/topic/3917-importing-users-and-content-from-joomla/ http://www.noupe.com/cms/processwire-cms-with-a-difference-77309.html http://processwire.com/talk/topic/2129-justifying-diy-coding-vs-installing-modules/?p=20438 I understand what it's all about to transition from Joomla to ProcessWire. If you need help, just post and we'll jump in. Welcome again, Matthew
    2 points
  4. Hello, I'm working on my first project with PW. Working with PW is amazing so far. As I am coming over from the Joomla world I am used to adding scripts to individual pages with a Joomla built in method. Searching for the PW way of doing this, I came along that post where I found this snippet of code: $config->scripts->add($config->urls->templates . "scripts/lightbox.js"); Great, I thought. But using just that snippet wouldn't include the script. I had to add a second snippet foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>"; (which I also found in that other post) to actually load the script wherever I wanted in my template file. Lets assume you are working with the default PW Profile on a fresh install and want to load the lightbox.js only on the homepage and the template file for your homepage is home.php. Then you would include the first snippet in your home.php. The second snippet goes either in your head.inc into the head section or in your foot.inc at the bottom (whereever you prefer to load your js). This is a quite generic way to include scripts. If you wanted to have another script loaded only, lets say, on a contact page with template file contact.php the you just need to add a snippet, e.g. $config->scripts->add($config->urls->templates . "scripts/contact.js"); to contact.php. The second snippet foreach($config->scripts as $url) echo "<script type='text/javascript' src='$url'></script>"; already sits in your head.inc or foot.inc where you put it before and it will take care of including also contact.js because of the foreach loop. I guess that most of you already know this. But for a newbie like me I had to write this down to properly digest it and maybe it is helpful to someone else. Cheers gerhard
    2 points
  5. This module redirects ID based URLs to the full SEO friendly URL Modules directory: http://modules.processwire.com/modules/process-redirect-ids/ Github: https://github.com/adrianbj/ProcessRedirectIds Very simple module that alllows you to link to pages with their page ID in the URL. The ID can be in any location in the URL. There is a config option to simply load the content to the ID based URL, rather than redirecting to the original PW url if you prefer. If you use this option, the module adds a canonical link to the page to help identify the ID based URL as a duplicate of the proper PW url so Google won't penalize you for duplicate content. For example you could do any of the following, where 1058 is the ID of the page you want to load: http://www.mysite.com/1058 http://www.mysite.com/1058/this-is-the-fancy-title http://www.mysite.com/category1/category2/1058/any-text-you-want/ http://www.mysite.com/category1/category2/any-text-you-want-1058/ Any of those will redirect to the proper URL, eg: http://www.mysite.com/this-is-the-fancy-title/ At the moment for this to work, the page ID segment of the URL must be the only segment that is all numerical, otherwise, anything goes. The reason for this module is mostly as a way to have a very simple shortlink to any page on the site, but it also allows for structuring URLs however you want with any content you want. I guess this could be abused and potentially bad for SEO! I am not sure if this is a good way to do this, so I would definitely appreciate any feedback.
    1 point
  6. Field dependencies are coming in ProcessWire 2.4, and I just wanted to give you guys a little preview of it. The development of this new feature is being sponsored by Avoine, the company where Antti works (he also specified how it should work). Field dependencies are basically just a way of saying that one field depends on another. It dictates which fields should be shown in a given context. In our case, it also gets into whether a field is required or not. This short video demonstrates how it works: (switch to the 720p and full screen version, as YouTube's default settings for this video make it impossible to see): // Edit @Adamkiss: Here's link for those on mobile: youtu.be/hqLs9YNYKMM The implementation here is done both client-side and server side. Javascript handles the showing/hiding of fields and the required vs. not required state changes. On the server side, it doesn't process any fields that aren't shown, and honors the required rules. A separate processing occurs both client side and server side, ensuring that the user can't make their own rules by manipulating the markup or post data. These field dependencies can be used with any Inputfield forms. That means you'll be able to use it not just in ProcessWire, but in FormBuilder, and via the API too. It's very simple to use from the API. All you have to do is specify a ProcessWire selector to either "showIf" or "requiredIf" to the Inputfield, and ProcessWire takes care of the rest: // show this field only if field 'subscribe' is checked $inputfield->showIf = "subscribe=1"; // show this field only if 'price > 0' and at least one category selected $inputfield->showIf = "price>0, categories.count>0"; // make this field required only if 'email' is populated $inputfield->required = true; $inputfield->requiredIf = "email!=''"; This feature will be in the 2.4 core (rather than as a separate module), so it will also be ready and available for things like module and field configuration screens.
    1 point
  7. Hi all! I have created this new module that improve the current search engine on PW: https://github.com/USSliberty/Processwire-site-indexer (Beta version) The main idea is to create an hidden field that store keywords (separated by space). The keywords are generated automatically from all text fields in the page, plus PDFs and DOCs files. So if you create new text fields you can forget to add they on Search Page Module. The only thing to do after install, is to change the list of fields in Search Page (see attachment). In fact you need to search only in "indexer" field. NOTE 1: At this time the module index only when you save the page. In the next week maybe i will add the complete-site re-index. NOTE 2: The files are indexed with 2 Unix packages (poppler-utils & wv). I have tried without success with pure PHP classes, but if know a class that works fine i can add it into module. ADB
    1 point
  8. Hi I contacted bitnami to suggest adding processwire to the bitnami catalog They just contacted me that they have added processwire to their catalog as per the link below https://bitnami.com/product/processwire You can vote for processwire in their monthly contest.
    1 point
  9. Hi everyone, I just want to share the good news, we launched a new website for a cafe in Melbourne, LuxBite. This is my first processwire website after years of experience using joomla and wordpress, this is by far one of the cms I enjoyed working with. Please visit the site http://Luxbite.com.au and leave your feedback! In short, I would like to thank all the community here - the forum is extremely useful and has a lot of information. This site is built on top of The amazing SimpleNavigationMarkup module by Soma - to be honest I am lazy to do foreach to output everything so utilizing this module is the way to go there are couple of outstanding issues and design changes that I need to work on but so far so good Extras: http://www.news.com.au/lifestyle/food/masterchef-cake-challenge-helps-revive-a-taste-for-flavours-of-the-past/story-fneuz8wn-1226666481357
    1 point
  10. Guys, this aspect has tormented me in the past couple of weeks and I just want to hear more opinions. What is your approach towards translating websites, themes or apps? I have recently discovered this tool: https://poeditor.com which sort of seems to me more human than the other mainstream crowd translation tools and I've been using its API and exploring its functions. I;m sure that translators really feel at home when working in a helpful interface. However, I still find proofreading a problem... What do you think?
    1 point
  11. Welcome gebeer, There're some ProcessWire addicts over here, watch out, so you've been warned now! if(count($page->images)) { foreach($page->images as $img) { if($img->width > 600) { $config->styles->append('/path/to/popup.css'); $config->scripts->append('/path/to/popup.js'); break; } } }
    1 point
  12. I really like the idea of that site/tool, but I would still worry that a crowdsourced translation might not be accurate. It's weird though, as I've been working on a multi-language site recently (soon to be launched!) and would feel happy to receive translation help from our German members on the forums here, but I sort of feel like I know them more than a stranger translating my content from afar if you know what I mean? I don't know them that well, but there's a level of trust here between members - it's a nice feeling On the other side of the coin, you can always run a crowdsourced translation back through Google Translate and check that the message is generally the same. This doesn't always work with technical terms, but definitely helps to reassure you that nobody's dropped in any swear words or anything malicious. I think there might be times I would use the website you linked to, but they would be for community/group projects where it's a small team and they can't afford the translation service or don't have the skills in-house. For all other sites I would pretty much always recommend a professional service as there's some sort of Service Level Agreement in place so you have someone to shout at work things through with in a short space of time if the translation is wrong
    1 point
  13. Sorry, I forgot to say Welcome !
    1 point
  14. You can also populate a page field with a custom php code in the field settings and use api to fill dropdown with child pages of current page. Like context aware.
    1 point
  15. You could also create a multiple page field and choose callouts page as parent. users can select them and drag them around to position.
    1 point
  16. I found the answer to my question. Created a "callouts" repeater with a page field called "callout" listing my callouts page children. Works perfectly. The flexibility and amount of user of PW is simply astounding!
    1 point
  17. Greetings, Nice work. Thanks for exposing us to your site! Matthew
    1 point
  18. Pete, now that I was getting used to the thing on your neck...
    1 point
  19. Loving both the site and the subject. Looking good on mobile.
    1 point
  20. If you need any help, just let us know. Everyone here teaches everyone else something at some point
    1 point
  21. Hi evanmcd Template caching does cache the template output (db queries, php processing etc.) This has nothing to do with the headers. Also the caching is disabled if you're logged in, so you could try another browser or log out to check if you see any improvements.
    1 point
  22. RE: 3 - You need to install the core module - "Page Clone". Simply go to Admin > Modules > Process > Page Clone > install
    1 point
  23. Hi! On a bit of a rush here, just some short answers: Yes. PageArray, when treated as a string, should look like that. See PageArray->toString() for more details. You can access specific items with $pagearray->eq(0), $pagearray->eq(1), $pagearray->first(), $pagearray->last() etc. or iterate it with foreach. Through API or via admin UI? Both should be doable, admin UI has "copy" link and http://cheatsheet.processwire.com/ provides details for API side (tip: look for "clone" method from Pages or PageArrays.) No, created date tells when page was created, i.e. added
    1 point
  24. As a side note: I use English for my system and all my programs, no exception. But when I visit a site I'll read dutch. A turkish developer in Germany with a turkish system, would he want to use English, German or Turkush ? Making assumptions from collected language info is in my opinion not the way to go. The only way you can play nice using the domain name, as the user has 'chosen' for the language. ( sort of )
    1 point
  25. Thanks again Soma, I feel like an idiot right now having the status as a string (not done it anywhere else in my modules so was just being blind ). All working now - for those interested, this is the final code: public function init() { $this->pages->addHookBefore('trash', $this, 'preservePages'); $this->pages->addHookBefore('delete', $this, 'preservePages'); } public function preservePages(HookEvent $event) { $page = $event->arguments[0]; if ($page->template == 'template-name') { $page->addStatus(Page::statusHidden); $page->save(); $event->replace = true; $this->message("The page was hidden instead of deleted. Pages using the '" . $page->template . "' template can be linked to other pages, so deleting is prohibited"); } } As you can see, much simpler after Soma's expert help. @Soma: I can't mark both your replies as the Solved post, so will have to mark this one with the full code if that's okay?
    1 point
  26. str_replace("", "smile.gif");
    1 point
  27. I have just pushed a new version of the module that supports "Load" rather than "Redirect" so the url that is entered which includes the 4 digit page ID will stay in the browser address bar. Not sure if this will suit your needs or not, but it was an easy addition so I thought I'd add it anyways.
    1 point
  28. yeah, so that's a week to everyone/anyone else.
    1 point
  29. Greetings, Hey Beluga! First, welcome, and glad to see you here. I seem to recall many Joomla/Seblod conversations with you in the Seblod forums. Now, to your question... How much data are you talking about here? If it's a "reasonable" amount, it may be easier to just re-build the pages. ProcessWire has a terrific import feature that lets you take a csv file and pull the columns directly into ProcessWire fields, creating new pages. I have used it to pull in thousands of listings for a project I'm doing for a TV station (with 58 custom fields). Here are the general steps to follow: 1. Install the csv import module (http://modules.processwire.com/modules/import-pages-csv/) 2. Create your "content type" in ProcessWire with all the fields you need 3. Export the relevant tables from your Seblod database 4. Create a csv file from the data in step 3 5. Give your csv file a header row, the top cell of every column containing the exact name of your ProcessWire field 6. Go to admin > setup and run the csv import module (directions are very clear from there) It's really easy -- and fast. After you run this, you will have a set of pages in ProcessWire with the fields and data you need. I can provide more details if you need it. Thans, Matthew
    1 point
  30. Love your idea, Soma. I created a php file in the root of my site called tinymce.php which I can edit and then simply load in the browser www.mysite.com/tinymce.php to send all of the changes to all my tinyMCE fields. Here's my code for anyone who might be confused by this: <?php include('./index.php'); $fields = wire("fields")->find("name=body|sidebar|introduction|affiliates"); foreach($fields as $field) { $field->theme_advanced_buttons1 = "formatselect,|,styleselect,styleprops,|,fontsizeselect,forecolor,|,bold,italic,underline,strikethrough,|,hr,|,justifyleft,justifycenter,justifyright,|,bullist,numlist,|,indent,outdent,nonbreaking"; $field->theme_advanced_buttons2 = "undo,redo,|,tablecontrols,|,pastetext,|,link,unlink,anchor,|,image,|,replace,|,removeformat,|,code,|,fullscreen"; $field->theme_advanced_buttons3 = ""; $field->theme_advanced_blockformats = "p,h2,h3,h4"; $field->plugins = "inlinepopups,safari,media,paste,fullscreen,table,nonbreaking,searchreplace,style"; $field->valid_elements = "*[*]"; $field->content_css = "/site/templates/styles/content.css"; $field->custom = "theme_advanced_styles:Test Style=test paste_text_sticky:true"; $field->thirdparty = ""; $field->save(); } The name=body|sidebar|introduction|affiliates line selects all of my tinymce fields by name (Soma's example assumed that your tinymce fields all had tinymce_ prefixes on them, which mine do not, so I am just listing all of them out instead). It then loops through each matching field and updates each setting. Pretty cool!
    1 point
  31. In most cases there's not a lot to it: 1- Transfer all files from your local environment to the desired location on the 'webspace'. You would probably do this via ftp. I assume you know how to do this. Make sure to also transfer the .htaccess file, because sometimes this is hidden. 2- Make a database export of your local database (via PHPMyadmin or other tools). Do a database import of this stuff in your new database on the webserver. 3- Check the database credentials in the file site/config.php on the server (near the bottom of the files). If needed adjust to the online environment and databasename, login etc. That's it. All things should work now. There are a couple of things to keep in mind though: - if locally you developed the site in a subdirectory (e.g. localhost/test/) and you move the site to the webroot or subdomain, most probably links to files and images inside richtextarea's stop working. You would have to adjust the paths in your database export before importing it. - sometimes you need to change directory permissions for certain dirs to write permissions.
    1 point
  32. Greetings, onjegolders: I totally understand where you're coming from! I've spent the past three years using Joomla, and I am now moving away from it entirely in favor of ProcessWire. I still get clients that specifically ask for Joomla, and I have a couple of development partners that still want to use it. I'm convinced that it is my job to move away from Joomla. Maybe I can offer some general ways to approach this... I've got several opinions on this matter. But let me focus on one particular area that you mentioned... THE "CLICK TO INSTALL" ILLUSION When I first started using Joomla, I thought it was great to have all those extensions ready to install with a few clicks. But as time went on, I found that my clients wanted more specific styling and actions. Since every module and extension for Joomla is nearly a separate application, each one re-doing models and coding that often were already done by something else in the Joomla ecosystem (more on the Joomla ecosystem in another post), each one comes with its own (sometimes very extensive) styling and coding assumptions. These very often (let me emphasize very often) conflict with styling definitions you're using elsewhere in the site. If you just want to insert stuff into a pre-fab template and use it exactly as is, you can get along pretty well. But I have found it is inevitable that clients need something more customized down the line. At that point, all the time you "saved" with point-and-click is lost when you have to figure out what that extension developer did in there, or when you have to stop using an extension altogether and find another one that does something better and have to figure out how to transfer the arcane material from one extension's database structure into another one (for example). By contrast, in a community like ProcessWire, you can get the snippets of code necessary to do the same thing as the point-and-click operations. The difference is, the styling is up to you. Even more importantly, you are very clear about how the thing was coded and can re-code pretty quickly. The key here is having a strong community, because if there are people to help you out with the code it hardly takes any longer to do it that way than to install a "point and click" extension. Also, it's a real problem that in Joomla so many developers abandon their projects. Then you are left with a strange extension, and you are on your own anyway to decipher the code! I do agree that it's a difficult thing to convince people of this. But I'm becoming more confident in just stating that I can build the system they want, with more flexibility beyond the first stage. I've found that most clients do want to be able to add more features in the future. Another thing I have found: most people who say they want Joomla are only saying that because it's the first or second system that turned up in a Google search. But if you sit down with them and explain that you can go further with a system like ProcessWire, most clients will trust you. After all, the reason they are hiring you is because they want a professional to advise and direct them! If that were not the case, they would just build it themselves. I use a metaphor when sitting down with people who bring up the Joomla vs ____ comments.... It's like a horse race. At the starting gate, the Joomla horse jumps out to a fast lead. ProcessWire and CodeIgniter (for example) start off slower. By mid-race, it seems all but certain that Joomla will win. But more open systems build speed throughout the race. Coming around that last turn, you can see Joomla slowing down. By the end of the race, the Joomla horse is tired and confused, and often doesn't cross the finish line at all. Thanks, Matthew
    1 point
×
×
  • Create New...