Leaderboard
Popular Content
Showing content with the highest reputation on 09/28/2015 in all areas
-
Displays countries and continents and their iso codes. The "value" for each country is the two-letter country code. As an added bonus, the country names are displayed in the language of the user (sorted by name ASC) if the appropriate translation was added. read more ...10 points
-
Guys, finally the podcast episode where I talk about PW is out. It's spoken in Portuguese, so most of you won't understand a word, but still I wanted to shout it here http://10web.pt/programas/programa-15-diogo-oliveira-trabalho-remoto-e-internacional-processwire-e-webdesign/5 points
-
You got it... You could think that it's a row in the database but that's not the case. (Dive in MySQL to find out) Every field is stored separately with the ID of the page. So ProcessWire makes joins (indexed) to give you all the data back what you're asking ProcessWire. So Loading a page and calling the title will only load the title, leaving the other fields alone... ..... silly me... Welcome Nanook !3 points
-
Several ways. I'd suggest thinking about how best to represent the data using Processwire's Templates, Fields, Pages (specific PW terms) and then write a script to use the API to read your existing data and build those PW pages. It can have a very relational database feel to it and have tree-style hierarchy available too. There also are various ways to incorporate a separate database table (look in modules, fieldtypes, etc.). If that dataset has to stay where it is (maybe something else maintains it) you could use PW's very flexible API to interface to it. Wrap all your back and forth logic up in a module. Maybe hook into some Page functions to make it seem more built in.2 points
-
Apparently, sexiness http://vschart.com/compare/processwire/vs/silverstripe1 point
-
Thanks horst. I'll just change it, but still, i'm puzzled and would love to know the cause. I couldn't reproduce this, neither on linux nor windows. Sometimes I just want to slap myself really hard... I did not get the error previously because I'm running PHP 5.6, where my code is allowed, but not in older versions. I'm already so used to 5.6 -.- Prior to 5.6, properties are not allowed to be expressions (in my case, the concat of constants and strings). Thanks guys & cheers1 point
-
Are you sure? It's "ProcessPageEditChildren" here and works fine. (But there's an unrelated bug: tabs can be loaded even they are hidden, will fix it)1 point
-
Ok, so I have been reading up on how to "change the default language" in Processwire and most tips mentioned to change the Guest user's language to the one you'd want. Unfortunately, this does not work well for me. In fact, when I var_dump the contents of $user->name,$user->language->name I get different results depending on where I am in the site. I have set the language of user Guest to the new manually created language Dutch (nl). Not being logged in and visiting the root, results in the language name being default. Not being logged in and visiting another page, the results in the language name being nl. I am at a loss of why this happens but it's preventing me from setting the Guest users language to determine which language should be shown when not logged in, because the homepage ALWAYS reverts to the deault language which is NOT the one set for the Guest user. This is processwire 2.5.3. So... when my client asks me to change the default language of an already existing website, how do I do this without having to re-organise the whole language stuff? Imagine that this client can't make up his mind and wants to be able to change the language in which the site opens about every three months. Is this possible or am I doomed to go through the whole "upload Dutch language files into the Default language"-thing?1 point
-
Welcome to ProcessWire cssabc123, You interact with data in ProcessWire via the fields from a page. A page in ProcessWire has custom fields (where the data is). Every Page in ProcessWire is build from a template, that template tells the Page which fields the page has. In fact a template is a 'template' for a Page, you could call it a Page factory. Every template can have a template file. (the files in /site/templates/). When a Page has a template with a template file the page can be shown in the browser. When a Page is build from a template that has no template file, the Page can only be used as data container. But how do I get the data from an other Page you might think. That is where the $pages variable comes in. Go ahead and check out the docs.1 point
-
Hi cssabc123, welcome to the forum! Very quickly and resumed because of time constraints: - Holder - article 1 - article 2 - ... //holder.php foreach ($page->children as $article) { echo "<h2>{$article->title}</h2>"; echo "<p>{$article->summary}</p>"; echo "<a href='{$article->url}'>Read more</a>"; } //article.php echo "<h2>{$article->title}</h2>"; echo "<p>{$article->body}</p>"; I left lots of things out,like pagination, that you can read about here https://processwire.com/blog/posts/processwire-2.6.18-updates-pagination-and-seo/ But hope you get an idea.1 point
-
Hi, I'm not sure if this can be useful or not. Check by your self. I have created a little module around a set of 42 svg icons. (nearly a copy from Windows 10 iconset). It is very rudimentary at the moment. One can define settings for colors and size of the svg variations. Variations will be created on demand in a central directory (assets/svgicons/) and cached for later usage. The settings can be passed as selectorstrings. You can use a template variable $icon. To output markup for a plain svg icon in an image tag, you need to call the name: echo $icon->img("name=lock"); echo $icon->img("name=unlock"); If you want use it as a rollover with hover state, you need to call the function markup: echo $icon->markup("name=attention"); This gives you markup with default settings. If you need a clickable link, just define it in the selector string: echo $icon->markup("name=attention, link=/about/"); You can set / change the default values from template like: $icon->setColors(array(0, 111, 187, 0.2), array(219, 17, 116, 1.0)); $icon->setSize(180); and / or you can use individual settings for each icon: echo $icon->markup("name=document, size=32, color1=#775599, color2=blue, link=/about/"); // HEX colors or named colors echo $icon->markup("name=idea, size=120, color1=255-255-0-0.3, color2=255-255-0-1, link=/about/"); // RGBA colors echo $icon->markup("name=home, size=20, color1=230-0-0, color2=230-0-0, link=/about/"); // RGB colors . For the rollover / hover markup there is a piece of css needed what can be outputted (only once). It can be fetched with or without the style-tags: echo $icon->css(); // with style tags echo $icon->css(true); // suppress the style tags . The functions that does not output markup return the module itself (the $icon object). So you can use them chained: // all functions that can be chained: $icon->emptyCache()->setSize(100)->setColors(array(0, 111, 187, 0.25), array(243, 79, 159)); // after such a (re)set call, you only need to pass a name to each icon call to get consistent results: echo $icon->markup("name=lock, link=/logout/"); echo $icon->markup("name=unlock, link=/login/"); // you can override single settings, ->mu() is a shortcut for ->markup() echo $icon->mu("name=trash, size=200"); echo $icon->mu("name=key, color2=red"); // ->presentation() print the whole collection with optionally individually specified size and colors: echo $icon->presentation(100, array(0, 111, 187, 0.25), array(243, 79, 159)); . . . The code is here in a gist: https://gist.github.com/horst-n/f6922f6fa228991fd686 . Download it as ZIP! . . A live demo is here: http://images.pw.nogajski.de/svg-icons/ . .1 point
-
vagrant (+ virtualbox) + git is pretty encapsulated vagrant streamlines the process of generating virtual machines to develop on, by providing 'prepackaged' virtual images + options to include other provisioning software (like puppet, chef, etc.). Some use Vagrant VMs as 'apps', meaning that each project has its own virtual machine, some other people have one VM for multiple sites (a la *AMP software). In your case, you could have your site versioned in git, together with your mysql dump and Vagrantfile (vagrant 'recipe' for your vm), and when you come to new machine, you'd do something like 'git clone project && cd project && vagrant up', go have a coffee, come back and start working. (of course, it's never quite that simple IRL , but in gist vagrant is quite nice. I am in the process of setting up local vagrant from clean ubuntu + serverpilot.io over vpn. fun times)1 point
-
If you want to stick with a password field you can do this: if($page->password->matches($input->post->pass)){1 point
-
Thanks for the snippet. If FEEL will be made into a module then something like this is required. I'm still unsure whether a module would make things much easier. But it would improve its popularity for sure. Just committed some updates (dev) so now individual edit links can have custom options too.1 point
-
The dev branch contains the latest updates on FEEL. It has some BC breaks but it's for the better Some highlights: new feature: edit page template on ctrl-click redesigned class system changed edit link html element to "<feel />" wrapper element removed extendable options rewritten & more verbose docs make the helper function the recommended usage mode using "all: initial" to reset all styles of edit links As the helper function is promoted as the main usage mode, perhaps FEEL could be made to a module. Any thoughts on this?1 point
-
I just want to quickly add: If posting the url to this forum is the seo strategy and we won't hear back from you I'm going to remove the link in the entry posting.1 point
-
Not only does that article use weird terminology (popular interpretation of adaptive web design is something entirely different), but it's also missing important parts of responsive web design – including the whole point of doing web design in a device-agnostic way. In most cases I'd rather suggest looking into ways of improving your responsive design workflow with mobile-first approach, lazy-loading assets, etc. Either way, if you really need to go with server-side device detection, you might want to look into Mobile Detect module. It's far from a complete solution in this regard, but one step closer to what you're looking for1 point
-
thanks for the hint. There are 2 new files to translate in 2.6.17. Translation updates are now available (https://github.com/Manfred62/pw-lang-de-dev). The "Edit" must first be added in the wire/templates-admin/default.php to get translated. In my translation file it's already included. See GitHub: https://github.com/ryancramerdesign/ProcessWire/issues/13971 point
-
That's seems like a viable solution, but only for the active current page. You also just set the "item_current_tpl" and that's only for the current active page. If that's the idea that's ok. MarkupSimpleNavigation doesn't change any page context at all. So the $page you have there's is only the current page viewing. When working with a hook, you would have to check for current page with if($child === wire("page")) { // do your markup logic } Taking the example from the readme I linked earlier it would be like: $nav = $modules->get("MarkupSimpleNavigation"); function myItemString(HookEvent $event){ // the current rendered child page $child = $event->arguments('page'); // if current child you're viewing if($child === wire("page")) { $myimage = $child->images->getTag('icon')->width(50); $itemMarkup = "<div class='nav-icon'><img src='{$myimage->url}'></div><a href='{$child->url}'>{$child->title}</a>"; $event->return .= $itemMarkup; // send back the markup that will present a item } } // setup the hook $nav->addHookAfter('getItemString', null, 'myItemString'); // a render will then also trigger the hook above on each item echo $nav->render(); This would allow to have all different logic in your output depending on custom criterias1 point
-
$pageArray->has($page); http://processwire.c...er=has Also it doesn't matter if you add duplicates as PW will remove them anyway.1 point