Leaderboard
Popular Content
Showing content with the highest reputation on 02/26/2015 in all areas
-
Hey, in a recent discussion we talked about one body field vs. PageTableExtended (or similar content splitting). Because of this I created a little Proof-of-concept including a CKEditor plugin and ProcessHannaCodeModal.module. As I don't have a lot of spare time in the moment (because I'm going on vacations for five weeks on monday So I have spare time but no computer to continue working on this ) I thought I share the current progress with you. Feel free to use those files to continue working on it or something similar. Here's a little screencast (I'm using the "lightwire" CKEditor skin in it): And here are the files: HannaModal.zip8 points
-
Here's a more complete answer. Tested and works as expected. function navList($items, $level = 1){ $max_levels = 2; $level == 1 ? $class = "parent" : $class = "child"; $out = ''; if ($level <= $max_levels){ $out = "<ul class='$class'>"; foreach ($items as $item){ $out .= navItem($item, $level); } $out .= "</ul>"; } $level++; // increment level each time this function is called. return $out; } function navItem($item, $level){ $url = $item->url; $attr = ''; if ($item->template == "redirect"){ if (trim($item->redirect) == "") return; // skip because the field is blank. $url = $item->redirect; if($item->new_window == 1){ $attr = "target=_blank"; } } $out = "<li><a href='$url' $attr>$item->title</a>"; if ($item->numChildren > 0){ $out .= navList($item->children(), $level + 1); // get recursive } $out .= "</li>"; return $out; } echo navList($p); No need to do anything other than get the top level nav items and set the $max_levels if different than 2. You can of course probably do all of this as easy/easier with MarkupSimpleNavigation, but it's not necessary if all you need is this.4 points
-
Eheh, I want to see how you are going to correct those two "know" that should be "now" in the text3 points
-
Just to sort up the things you've mixed... Frontend Look == Your Choice and your CSS under /site/templates Backend Look / CSS Classes in CKE / Float right, left and so on.... == just Backend styling not related to the Frontend until you setup up all that stuff... Let's go How to: 1. Frontend first - How your CSS get the HTML from the Wysiwyg? 2. Frontend CSS - What classes you use for your template image left, right and so on 3. What is CKE changing in the Source if you click on "Image left" -> take a look for that Output with the source button in CKE after changing something with the Style things 3. CKE modification to get the look like in the frontend -> 2 files are to setup/create/put the path in the field settings! --> mystyles.js (may you create one in /site/templates/scripts) --> contents.css (may you create one in /site/templstes/styles) What? What do this files...ok this two files do two things... 4. mystyles.js This could be set in your CKE Field to the path of your choice and "override" the items in the "styles" menu!! Really cool stuff to setup here. Example from real Life (the labels in german but i think you get the idea how to use it...): CKEDITOR.stylesSet.add( 'mystyles', [ //images { name : 'Bild links mit Vorschau' , element : 'img', attributes : { 'class' : 'thumbnail align_left vorschau' } }, { name : 'Bild rechts mit Vorschau' , element : 'img', attributes : { 'class' : 'thumbnail align_right vorschau' } }, //lists //{ name : 'Liste mit Pfeil' , element : 'ul', attributes : { 'class' : 'pfeil' } }, //{ name : 'Liste mit Check' , element : 'ul', attributes : { 'class' : 'check' } }, //headings { name : '3 Alt. Schrift' , element : 'h3', attributes : { 'class' : 'extrafont' } }, { name : '4 Alt. Schrift' , element : 'h4', attributes : { 'class' : 'extrafont' } }, //tables { name : 'Tabelle normal' , element : 'table', attributes : { 'class' : 'pure-table' } }, { name : 'Tabelle mit Rahmen' , element : 'table', attributes : { 'class' : 'pure-table pure-table-bordered' } }, { name : 'Tabelle nur Zeilentrennung' , element : 'table', attributes : { 'class' : 'pure-table pure-table-horizontal' } }, /* Object Styles */ // This styles are only available when you select the defined objects. E.g. when selecting an image // you can control here with the styles dropdown the styling. // Here you can define Divbox classes as well these are shown on "Create div Container" { name : 'Gruene Box', element : 'div', attributes : { 'class' : 'alert alert-success', } }, { name : 'Gelbe Box', element : 'div', attributes : { 'class' : 'alert alert-warning', } }, { name : 'Rote Box', element : 'div', attributes : { 'class' : 'alert alert-danger', } } ]); 5. contents.css The contents.css override the CSS of the content of the CKE field in the backend so this is the thing where you tell the CKE how to look like your frontendcontent...for example also the background image fo the frontend could shown up in the backend... Example: /** * General editor styles (regular mode only) * * See contents-inline.css for inline styles. * */ /* Template CSS ONLY */ @import url("bootstrap.css"); @import url("font.css"); @import url("style.css"); /* WORKSPACE EDITOR SETUP */ body { padding: 10px; } /* CORRECT THE ORIGINAL STYLESHEET */ Oh this was the easy part just import your stylesheets in there and correct some wired things like add some padding in the CKE only to get some whitespace for the editor... Some more Links on this topic: https://processwire.com/talk/topic/8342-adding-css-classes-to-ckeditor/ http://docs.ckeditor.com/#!/guide/dev_styles http://www.flamingruby.com/blog/processwire-weekly-13/#1-1 regards mr-fan3 points
-
Sometimes i work with themeforrest HTML themes on projects with low budget...fun fact is with PW I get a HTML theme up and running with normal content in a few minutes... But hey a WordPress theme with xxx dependencies and a insecure cms only cost the double price...3 points
-
Just add .xml to the name ans disable trailing slashes.2 points
-
MarkupCache clears at a default interval of an hour, but you can specify less time if you want. $cache->get("menu-test",120); // 2 minutes No worries, I suspect it will be useful to someone else as well, so I figured I'd leave a solid example here.2 points
-
Written in browser, but something like: foreach ($TopLevelNavLinks as $p){ $url = $p->url; $title = $p->title; $attr = ''; if ($p->template == "redirect"){ $url = $p->redirect //redirect is the name of the URL field if($p->new_window == 1){ $attr = "target=blank"; } } echo "<li><a href='$url' $attr>$title</a></li>";2 points
-
For anyone looking for a great frontend approach / workflow that uses all the cutting edge practices and tools, I highly recommend taking a look at the Sage Starter Theme for WordPress (formerly known as Roots... they changed it to Sage and kept the "Roots" name as the parent organization name). Although Sage is built around WordPress, it's not difficult to strip away the WordPress related bits (mainly template related things and workarounds that fix some of WP's quirks) so it can work with ProcessWire. In fact, this has been my primary frontend technique for most ProcessWire sites. They have a great community over there as well. Relevant links: https://roots.io/ https://roots.io/new-website-sage-and-the-future/2 points
-
PageTableInline is really the thing I miss the most about "repeatable" parts of pages. Directly followed by settings to change its behavior like from multiplier to textareas profields. Either free adding of blocks, but maybe limited in number, or a fixed number of them which can be labeled, e. g. a page with three profiles (image, headline, text) and being able to call it like this: echo $page->profile_1->text; echo $page->profile_2->text; echo $page->profile_3->text; Funnily I've not used repeaters for a bit of time now, they are kinda useless for most of my usecases.2 points
-
@Sevarf2 The notice about the undefined index is fixed now in FieldtypePageWithDate v1.0.3 https://github.com/Rayden/FieldtypePageWithDate2 points
-
I already put a word in. I have been a Tuts+ Premium member for awhile. I'll also try other channels.2 points
-
Just wanted to share a simple bash script I've been using lately to make installing ProcessWire a little faster. Feel free to modify it to your taste! Just copy everything into a simple text file, I call mine "preparepw". Optionally, set this file to executable (chmod -x preparepw) and put it somewhere into your path to be able to load it as a regular command without the need to call it from sh ~/preparepw for example. To run, first cd to where you want to install PW's root, e.g. /sites/mysite/ then call the script. It will create a /sites/mysite/wwwroot/ directory containing all of PW's files from current master, set the required permissions and rename htaccess. It has an option to set the directory that, when unset, will default back to ./wwwroot. (e.g. preparepw public would install PW in ./public/). #!/bin/bash # Version 2.0 INPUT=$1 if [[ -z $INPUT ]]; then INPUT="wwwroot" printf "Directory option not set, installing into ./$INPUT/...\n" else printf "Installing in to ./$INPUT/...\n" fi # Select a version printf "\nWhich ProcessWire branch do you want to install?\n" options=("master" "dev" "devns") select BRANCH in "${options[@]}"; do test -n "$BRANCH" && break; echo ">>> Invalid selection, please try again"; done printf "\nDownloading ProcessWire $BRANCH branch, please hold on...\n" # Get ProcessWire master and prepare files if [ "$BRANCH" == "master" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/master.zip -# -L fi if [ "$BRANCH" == "dev" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip -# -L fi if [ "$BRANCH" == "devns" ]; then curl -o processwire.zip https://github.com/ryancramerdesign/ProcessWire/archive/devns.zip -# -L fi unzip -q processwire.zip rm processwire.zip if [ "$BRANCH" == "master" ]; then mv ProcessWire-master $INPUT fi if [ "$BRANCH" == "dev" ]; then mv ProcessWire-dev $INPUT fi if [ "$BRANCH" == "devns" ]; then mv ProcessWire-devns $INPUT fi chmod -R u+rwX,go+rX,go-w $INPUT mv $INPUT/htaccess.txt $INPUT/.htaccess cd $INPUT # Prompt for site profile printf "\nWhich site profile will you be using?\n" select d in site-*/; do test -n "$d" && break; echo ">>> Invalid selection, please try again"; done mv $d site/ rm -rf site-*/ # Set permissions chmod 777 site/assets chmod 777 site/modules chmod 666 site/config.php printf "\n" read -p "Press [Enter] once you've finished the installation process to remove the install files..." rm install.php rm -rf site/install printf "\nInstallation files removed.\n" printf "\nDirectory \"$INPUT\" all set for ProcessWire. Have fun! \n"1 point
-
Hi, I'm having an issue when trying to edit a page through the ProcessWire CMS. When I click on the Edit button, the page loads fine. But, if I then navigate to another page (say, the modules tab) I am logged out. This only happens on a few pages, such as /stories/ and its children. Every other page on the site is absolutely fine and I can edit without being logged out. The weirder thing is when I view this page on the front-end, I am also logged out. It just seems that the simple act of getting a page from the DB causes me to log out, and I can't see the connection. This is causing us some problems since this website is for Hilton, and with 88 people currently registered on the site (and many more to come), we're getting a lot of phone calls. I'm not sure how this can be anything we have done, since we have not modified the Admin Panel or the Core code whatsoever, and that simply going to edit one of the affected pages in the admin panel logs us out. And I repeat, every other page is fine. The website is here: https://extraordinaryfb.com/ Unfortunately, it's a private site, and requires registration with a Hilton associated email address, so I am not a liberty to create an account for somebody to view the site themselves. If anybody can tell us what might be happening, that'd be great. Many thanks in advance. And on a side note, I could not register with my normal company email address since your forum tells me it's an invalid email address. It's a @progress.digital email address, and it is perfectly valid. Only allowing .com/.co.uk and other common TLDs does not conform with email standards. Though I must say, your ProcessWire system is very impressive and we have found it great to work with. Extremely extendable.1 point
-
1 point
-
I needed a break from a project I was stumped on, so here's a version that creates a bootstrap menu (at least the best I can tell, since I don't use bootstrap, I just went by your sample code). I stripped out a few of the things to make it more general, but you could easily use it to create your menu. Renders lightning fast here. <?php function navList($items, $level = 1){ $max_levels = 2; $level == 1 ? $attrs = 'class="nav navbar-nav navbar-right"' : $attrs = 'class="dropdown-menu" role="menu"'; $out = ''; if ($level <= $max_levels){ $out = "<ul $attrs'>"; foreach ($items as $item){ $out .= navItem($item, $level); } $out .= "</ul>"; } $level++; // increment level each time this function is called. return $out; } function navItem($item, $level){ $url = $item->url; $attrs = ''; $itemClass = 'nodropdown'; if ($item->template == "redirect"){ if (trim($item->redirect) == "") return; // skip because the field is blank. $url = $item->redirect; if($item->new_window == 1){ $attr = "target=_blank "; } } if ($item->numChildren()){ $itemClass = 'dropdown'; $attrs = 'class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false" '; } $out = "<li class='$itemClass'><a href='$url' $attrs>$item->title</a>"; if ($item->numChildren > 0){ $out .= navList($item->children(), $level + 1); // get recursive } $out .= "</li>"; return $out; } ?> <nav class="navbar navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="<?=$config->urls->root;?>"><img src="" class="Logo" alt="Logo" /></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="navbar-collapse-1"> <?php $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("main-nav")) { $data = navList($pages->get("/")->children()); $cache->save($data); } echo $data; ?> </div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>1 point
-
Very handy! Thanks for taking your time to look into all of this. I havn't even had the chance to add the checkbox logic and you have all of the sample code. I will use that timer code to start timing things on future snippets.1 point
-
I just quickly built a menu using: $navItems = $pages->get("/")->children("template!=syllabi"); That creates a 2 level menu with 15 parents, and about 65 children. Without any markupCache total time: 0.6733 With MarkupCache total time: 0.0018 I tested them like so: $t = Debug::timer(); echo navList($p); echo Debug::timer($t); $t = Debug::timer(); $cache = $modules->get("MarkupCache"); if(!$data = $cache->get("menu-test")) { $data = navList($p); $cache->save($data); } echo $data; echo Debug::timer($t);1 point
-
Nice.. Can I tell it to only go 2 levels since that is all bootstrap supports?1 point
-
This is what I am using right now to make bootstrap menus with active link colors and drop downs before I add the above new window redirect code: <?php $LogoImage = 'logo.png'; $NavColor = 'navbar-default'; //navbar-default or navbar-inverse //Make the menu //echo the starting code echo '<nav class="navbar ' . $NavColor . ' navbar-fixed-top" role="navigation"> <div class="container"> <!-- Brand and toggle get grouped for better mobile display --> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapse-1"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand" href="' . $config->urls->root . '"><img src="' . $config->urls->templates . 'images/' . $LogoImage . '" class="Logo" alt="' . $LocationPage->title . ' Logo" /></a> </div> <!-- Collect the nav links, forms, and other content for toggling --> <div class="collapse navbar-collapse" id="navbar-collapse-1">'; echo '<div id="AboveNav"><i class="fa fa-phone"></i> ' . $LocationPage->Location_PhoneNumber_Switchboard . ' <i class="fa fa-flag"></i> ' . $LocationPage->Location_AddressStreet . ' ' . $LocationPage->Location_City . ', ' . $LocationPage->Location_StateAbrv . '</div><!-- -->'; echo '<ul class="nav navbar-nav navbar-right">'; //Make the top level links $TopLevelNavLinks = $pages->find('parent=1, sort=sort'); //add home link echo '<li><a href="/">Home</a></li>'; //could use $config->urls->root //Build Top Level Links foreach($TopLevelNavLinks as $TopLevelNavLink){ //Look up this top level link to build a drop down if it needs it $SecondLevelNavLinks = $pages->find("parent=$TopLevelNavLink->id, sort=sort"); $SecondLevelTotal = $SecondLevelNavLinks->getTotal(); //If I am on this page, add the active class if($page->id == $TopLevelNavLink->id){ $classTag = ' active'; } else { $classTag = ''; } //if there is atleast one sublink, put me in a dropdown if($SecondLevelTotal > 0){ //Dont make link take user to page. Instead, open a dropdown menu. echo '<li class="dropdown' . $classTag . '">'; echo '<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">' . $TopLevelNavLink->title . ' <span class="caret"></span></a>'; echo '<ul class="dropdown-menu" role="menu">'; //loop through the second level foreach($SecondLevelNavLinks as $SecondLevelNavLink){ //If I am on this page, add the active class if($page->id == $SecondLevelNavLink->id){ $classTag2ndlevel = ' class="active" '; } else { $classTag2ndlevel = ''; } echo '<li' . $classTag2ndlevel . '><a href="' . $SecondLevelNavLink->url . '">' . $SecondLevelNavLink->title . '</a></li>'; } echo '</ul>'; } else { //Make link take user to page echo '<li class="nodropdown' . $classTag . '"><a href="' . $TopLevelNavLink->url . '">' . $TopLevelNavLink->title . '</a></li>'; } } //end of built top level nav links //echo the ending code echo '</ul></div><!-- /.navbar-collapse --> </div><!-- /.container-fluid --> </nav>'; ?>1 point
-
I was thinking about launching a new CRM and calling it Vista — I don't see the problem.1 point
-
Add the new window checkbox to your template. If "new_window" = 1 add "target=blank" to your <a> tag on output.1 point
-
I cut them off ^^. It's the last part anyway Edit: to much work. Have to learn for an exam tomorrow so they'll stay1 point
-
I can confirm this here. I've always set $c->status = 1, so I never noticed that it's not actually working correctly. Looking at comment.php, I thought perhaps setting $c->status = $c->statusSpam might do it, but still saves as 1 in the DB.1 point
-
1 point
-
1 point
-
If I view the source, your admin theme has all the following (at least on the login page) that isn't present in PW's admin theme. There may be more but this is just what I observed on a brief glance: <link rel="apple-touch-icon" sizes="57x57" href="/apple-touch-icon-57x57.png"><link rel="apple-touch-icon" sizes="60x60" href="/apple-touch-icon-60x60.png"> <link rel="apple-touch-icon" sizes="72x72" href="/apple-touch-icon-72x72.png"> <link rel="apple-touch-icon" sizes="76x76" href="/apple-touch-icon-76x76.png"> <link rel="apple-touch-icon" sizes="114x114" href="/apple-touch-icon-114x114.png"> <link rel="apple-touch-icon" sizes="120x120" href="/apple-touch-icon-120x120.png"> <link rel="apple-touch-icon" sizes="144x144" href="/apple-touch-icon-144x144.png"> <link rel="apple-touch-icon" sizes="152x152" href="/apple-touch-icon-152x152.png"> <link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon-180x180.png"> <link rel="icon" type="image/png" href="/favicon-32x32.png" sizes="32x32"> <link rel="icon" type="image/png" href="/android-chrome-192x192.png" sizes="192x192"> <link rel="icon" type="image/png" href="/favicon-96x96.png" sizes="96x96"> <link rel="icon" type="image/png" href="/favicon-16x16.png" sizes="16x16"> <link rel="manifest" href="/manifest.json"> <meta name="msapplication-TileColor" content="#ffffff"> <meta name="msapplication-TileImage" content="/mstile-144x144.png"> <meta name="theme-color" content="#ffffff"> <link rel="stylesheet" href="/wire/modules/AdminTheme/AdminThemeDefault/styles/override.css"/> While none of these are likely to be the source of the problem, it does indicate that core files have been changed. So in debugging this, the first thing you should do is restore the core to a fresh version with no modifications (you can always go back). If you need to present a custom admin theme to the client, put it back in after the problem is resolved, and put it in /site/modules/ so that you aren't delivering something to the client that can never be upgraded. Even something as simple as changing the character set on a core file could cause problems. The issue you are seeing most likely is something interfering with the http headers, which could be as simple as a core file that changed character sets and now has some invisible character preceding an opening PHP tag at the top of a file. That may not be it either, but since you are seeing an issue here that has not turned up in PW before, definitely get a fresh copy of the core before debugging further.1 point
-
World first 3D printed jet engine enjoy this clip: more: http://www.gizmag.com/3d-printed-jet-engine/36273/1 point
-
Just reading your additional responses. Interesting that it doesn't affect all users. Try setting $config->sessionFingerprint to false, as perhaps the logout is the result of a dynamic IP address change or something in the user agent string changing. Though if the logout only occurs on one page, that still points to something up with that particular page. I'm actually wondering about something on the server outside of PW, like mod_security or similar messing with the session due to a combination of factors present on that page.1 point
-
I think this forum software may have been made before the newer longer email addresses, but I'm sure they'll account for that in a future update. A lot of email address validators currently validate the last portion as being between 2 and 4 characters, and I'm guessing that's the case with IP.Board. That reminds me, I need to go double check that PW's $sanitizer->email() isn't one of them. The first thing I'd suggest doing is enabling debug mode by editing /site/config.php and setting the $config->debug=true; That should enable any obvious errors to appear on the screen. Getting logged out from a particular page suggests that some kind of output is occurring before the http headers, causing the session cookies to be lost. Remember to turn debug mode back off once you've tested things out to see if there are any errors being suppressed. Your admin theme appears to be heavily modified (found the admin login page), so that's one thing to look at. Restore the non-modified admin theme, by replacing the /wire/modules/AdminTheme/AdminThemeDefault/ with the original. Move your modified version to /site/modules/AdminThemeCaelan/ (or something like that) so that you can install core upgrades without losing your modified admin theme. The same goes for any core module–if you need to modify it, copy it to /site/modules/ModuleName/ and work with that instead. Otherwise you'll lose all your changes every time you upgrade PW. Speaking of upgrades, you might also want to upgrade to the latest PW dev version 2.5.20, as it contains a lot of fixes and enhancements that your site may benefit from. Though the issue you mention with logouts is not one I've heard of before. But it's worth a try. If none of this helps feel free to PM me a login so that I can take a look at the page in question and I can examine the http headers to see what is causing the session to break.1 point
-
I know that and have it enabled, but the "busy" people of us maybe don't enable that, but would still happily answer, if someone is asking for their opinion / knowledge.1 point
-
It would be nice to at least have something like "PageTableInline" than - otherwise I will have to open a modal for every page section which can be really annoying if you have a lot of them1 point
-
This would be great, especially as one doesn't automatically follow topics. But the link you both posted doesn't work anymore.1 point
-
1 point
-
Thanks Macrura, I am glad that you could pinpoint the issue. I already fixed it, see this commit1 point
-
Thanks, this is awesome! I've seen people mention scripting PW installations, it's very helpful to see an actual example.1 point
-
If chosen is not working is should report this back, so I should be able to just unhide the textarea to allow adding of pages. Edit: Just pushed a commit to add this. Now you can at least add pages. Will take a look at the fork later.1 point
-
Guys, this thread gave me the impulse I needed to finish an idea that I started long ago. So, here is a new module for using image fields inside textarea using the same markup language that you are using in that same text area https://github.com/ocorreiododiogo/pw-image-fields-markup edit: still testing and work in progress, so I'm not submitting to the directory yet1 point
-
Nico, I used to have the exact same setup (it still lingers on a site that I haven't transition to PTE yet). In my case, it always seemed to work great. However, it sounds like Ryan has no plans to provide any further dependency support for repeaters. I'll be moving the repeaters shown above to PTE soon — just feels like a better solution.1 point
-
1 point
-
since everyone is trying to make themes based on their own wishes and needs, I tried to have a view from our clients: what do they really need? how often? what should they see and what not...? so I ended up with a really clean theme. the trash page will not be shown in the page tree. I'll move it in the right bottom corner. some footer informations are not necessary to be visible all the time (eg. pw version, copyright). I want to hide them behind a button. I often see people looking for a "back button" because they don't want to use the browser back button (don't know why - maybe just my view?). some ideas for other features (like custom colors)? let me know what you think. thanks1 point
-
1 point
-
Done. Refer to https://github.com/ryancramerdesign/ProcessWire/issues/9291 point
-
About the Project This project is now online for some months and I'm happy to finally have the time and the customers approval to write about it. As some of you might know germany has one of the best health care systems in the world. If you live here you're enforced by the law to have a health insurance: As an employee you take care of choosing your "Krankenkasse" (health insurance provider) and your employer pays your dues to them like taxes. If you're selfemployed or earn more than "the average worker" you can also choose/have to get a private health insurance which (in many cases) covers more services (most people here for example know the "Chefarztbehandlung" which means if you ever need to get to the hospital your insurance guarantees that you will be treated by the head head physician). People who are are civil servants get something called "Beihilfe" from the state which partially covers your medical treatments costs depending on where you live / are employed at (the federal state), if you're married, have childs and a bunch of other factors. For the remaining rest you have to get a "Restkostenversicherung" which covers the remaining rest of your expenses for treatments. The problem with the "Beihilfe" system is: It's REALLY complex and you have to read a lot (or get help) to understand it's rules. That's why our customer, the Continentale Krankenversicherung a.G., one of germanys largest insurance companys, asked us and our friends from Aufgesang (a specialist agency for Online Public Relations, Content Marketing and SEO) to build a portal that informs potential customers and give them the posibility to get in touch with local experts. As a plus people who are interested in an insurance can calculate their costs without having to read through all official laws and brochures. There currently are three editors (all professional journalists) that constantly update content and write new texts to cover more in depth topics. Furthermore there are plenty of features that are planned to be released in the next years so the portal as a whole will continue growing and keep getting more usefull and hopefully get the #1 source of information for "Beihilfe" and "Restkostenversicherung" in Germany. <3 Processwire From a technical point of view there were many custom tailored things we've implemented in processwire. The Search uses a modified Version of Jonathan Darts excellent Elasticsearch Module (with a fallback to a basic text search in pw). We've created a lot of services and Tools to import Excel lists of experts and their coverage areas, complex rulesets for the costs calculation, a frontend calculation tool (built on top of Knockout.js), several HannaCodes to insert Download-Buttons and information within the content and last but not least a custom pdf-guide which is completely based on the users input and generated on the fly from the "Beihilfe-Rechner" (calculation tool). There also are mechanisms to inform experts when someone wishes to contact them, a newsletter service and many, many other things. Currently there are about 30 installed modules, 42 "Physical" template files (53 Templates all in all) ... and growing. I'm (still) really happy we were allowed to choose processwire for this project as we NEVER had any task we couldn't manage within the blink of an eye. If I think about having to build all those import tools in (i.e.) Typo3 I'm pretty sure we would have needed double the time. So once again: Thanks ryan and all contributors for building such an awesome piece of software. P.S.: We're currently searching for senior php developers to continue developing this and more portals and websites. If you're interested: Feel free to contact me! P.P.S: There are three more sites to come in the next weeks. I'll present them here as always1 point
-
http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/ Follow-up to this: http://blog.keithcirkel.co.uk/why-we-should-stop-using-grunt/ There are problems on Windows (surprise?). This approach looks appealing to me after just having set up Foundation with the whole Grunt shebang. The idea is that you face the same learning overhead with the configs of a build tool as with the options of a specific command line utility, so why not use the command line utils via npm? Build tools like Grunt or Gulp also bring other types of complexity to your workflow, especially as time goes on and backwards compatibility breaks somewhere in your toolbox.1 point
-
Macrura, nice. Please be aware of some possible YAML parsing pifalls. It's always advised to wrap strings, that are more than just one word in quotes, or prepend them with a pipe symbol. Commas are interpreted as array separators, so your example should be looking like this instead: - author: William role: Client text: "Integer eu libero sit amet nisl vestibulum semper. Fusce nec porttitor massa. In nec neque elit. Curabitur malesuada ligula vitae purus ornare onec etea magna diam varius." - author: James role: Hippie text: "Posuere erat a ante venenatis dapibus posuere velit aliquet. Duis llis, est non coeammodo luctus, nisi erat porttitor ligula, egeteas laciniato odiomo sem." or - author: William role: Client text: |Integer eu libero sit amet nisl vestibulum semper. Fusce nec porttitor massa. In nec neque elit. Curabitur malesuada ligula vitae purus ornare onec etea magna diam varius. - author: James role: Hippie text: |Posuere erat a ante venenatis dapibus posuere velit aliquet. Duis llis, est non coeammodo luctus, nisi erat porttitor ligula, egeteas laciniato odiomo sem. or multi line - author: William role: Client text: > Integer eu libero sit amet nisl vestibulum semper. Fusce nec porttitor massa. In nec neque elit. Curabitur malesuada ligula vitae purus ornare onec etea magna diam varius. - author: James role: Hippie text: > Posuere erat a ante venenatis dapibus posuere velit aliquet. Duis llis, est non coeammodo luctus, nisi erat porttitor ligula, egeteas laciniato odiomo sem.1 point
-
Go to the guest user and change language to what you wish i.e. Deutsch. Having english as a second language is also easy, you don't need language translation files for english as it's already english, so just keep (core) it empty.1 point
-
I am currently fighting with an e-commerce site that the client wants on WordPress. I think I am in genuine pain! Using woocommerce, which does offer the client what he needs (product with selectable digital download or physical cd) and simple management. But where I am losing sleep is over WordPress itself. Trying to customize how things are displayed and ordered is a minefield and the amount of included bits of stylesheets, scripts and so on is a mess. Though interestingly, the developer of Mega Slider (which I am using) has now had a little peak at dear ProcesssWire and is intrigued by it. Although it will be too late for this project, I would happily throw some time into taking the current shop module for PW and take it to its ultimate conclusion! I personally think that none of the currently available carts out there (Open Source or otherwise) are even remotely developer friendly. When you think about it, there is nothing very complicated about an online shop. It is simply displaying and collecting data - so why have all these projects become like swimming in glue?1 point
-
After Ryan's latest incarnation of Blog Profile I wanted to see if I could learn something from there to my own workflow. It turned out very nicely and this seems like a perfect template approach for me. Wanted to share it with you guys. Folder structure under templates folder: templates/markup/ templates/markup/helpers/ templates/markup/layouts/ templates/scripts/ templates/styles/ And it all begins from here: templates/markup/index.php -this is the "complete" html file, it has doctype, head and starting and ending body. There is very little "logic" here, it's more like a container. There is one very important code snippet there though: <?php if ($page->layout) { include("./markup/layouts/{$page->layout}.php"); } else { include("./markup/layouts/default.php"); } ?> Code above goes between header and footer of your site, that will be the main content. I call it layout, but the better name would be "content layout" or "inner layout" or something like that. Then the templates/markup/layouts/ folder will keep at least default.php file, but probably few others, like "threeColumns.php", "frontpage.php", "gallery.php" etc.. you got the idea. Each of the actual pw template files are then purely "controllers" - no actual markup generated there. All markup are done in files inside templates/markup/ folder and it's subfolders. This is how template file templates/home.php on one site I am building right now looks like: <?php // Carousel items $t = new TemplateFile(wire('config')->paths->templates . 'markup/helpers/carousel.php'); $t->set('carouselPages', $page->carousel); $page->masthead = $t->render(); // Tour themes $t = new TemplateFile(wire('config')->paths->templates . 'markup/helpers/items.php'); $t->set('title', "Get inspired from our <strong>tour themes</strong>"); $t->set('items', $page->featured_themes); $t->set('description', $page->themes_description); $t->set('url', $config->urls->root . "themes/"); $t->set('linkTitle', "All themes"); $page->main .= $t->render(); // National parks $t = new TemplateFile(wire('config')->paths->templates . 'markup/helpers/items.php'); $t->set('title', "Seven beautiful <strong>national parks</strong>"); $t->set('items', $page->featured_parks); $t->set('description', $page->parks_description); $t->set('url', $config->urls->root . "national-parks/"); $t->set('linkTitle', "All national parks"); $page->main .= $t->render(); $page->layout = "frontpage"; include("./markup/index.php"); This uses few "helper" markup files from templates/markup/helpers/ folder (namely carousel.php and items.php). Here is the carousel.php for your reference: <?php /* Generates the markup for the frontpage carousel */ if (count($carouselPages) < 1) return; $styles = ''; echo "<div id='carousel'><ul class='rslides'>"; foreach($carouselPages as $key => $p) { echo "<li class='c-item c-item-$key'>"; echo "<img src='".$p->image->getThumb('carousel') ."' alt='' />"; echo "<p>$p->summary</p>"; echo "<a class='button' href='{$p->link->url}'>$p->headline</a>"; echo "</li>"; } echo "</ul></div>"; Then populates the $page->masthead and $page->main properties and then set's the inner layout to "frontpage". That templates/markup/layouts/frontpage.php file is very simple on this site, but could be much more complicated if needed: <div id="masthead"> <?= $page->masthead; ?> </div> <div id="main" class="wrap"> <?= $page->main; ?> </div> Frontpage is rather unique and I could have done all the markup on the frontpage.php file also. But I do want to re-use those "carousel" and "items" components on other places as well. But if I do have totally unique stuff, where I do want to get "quick and dirty" this approach allows it. Then my template file would be something like this: $page->layout = "campaign2012"; include("./markup/index.php"); And then all the markup would be in that templates/markup/layouts/campaign2012.php Blog profile really gave me a good ideas (cleaner folder structure etc) and using TemplateFile class adds nice possibilities. This is of course just a one way to manage your templates, but hopefully someone of you finds this helpful when thinking about how you like to structure this stuff. PS: If you are just getting started with PW, then I recommend using the head and foot includes method from demo install. There is nothing wrong with that method and only more complicated sites starts to benefit from these methods introduces in this topic.1 point
-
Thanks for the interesting thread. If you (like me) don't like to put markup into variables, you can use the output buffer to use cleaner include files: ob_start(); include('./teaser.php'); include('./pager.php'); $page->body = ob_get_clean(); include('./main.php'); That way your include files can be html with php elements and not $page->body="<p>something</p>" I have one question to the main.php approach, though: I have a bunch of functions that are used by several templates. With the head/foot method I would simply put them into head.inc and make them available to every page. Where do you put this when using a main.php? Would that be a module? Thanks, thomas1 point