Leaderboard
Popular Content
Showing content with the highest reputation on 10/31/2014 in all areas
-
10 points
-
@Zenophebe: what we have now in ProcessWire and how it's flexible and all has been explained in this thread over and over again. Hope I'm not confusing this any more than is necessary, but I'd really like to hear a bit more about some of your points: What is it exactly that you mean by content type here, and how does it differ from what Templates and Pages currently provide? Could you name a solid example of a thing that "can't be represented as a page"? Please don't get stuck on the naming -- Page is just a name for a content item in ProcessWire (imagine that we're talking about nodes, articles, resources, or whatever makes you happy) and Template is just the metadata that defines what kind of content it holds, and so on. Names have absolutely nothing to do with what these items of content are capable of doing. The examples in your first post ($page->body->author->name etc.) are what one would in ProcessWire, typically, achieve through page relations. In this case I'm having hard time understanding what exactly "body" is though -- is it a field or is body supposed to represent a section of page with content of it's own? Is it just a deeper hierarchy that you're looking for? Another way to achieve similar structure would be by using a fieldtype with more complex content structure. Table field (not to be confused with PageTable, though that's another option) would be an example of this, though perhaps not quite what you're thinking of yet; you can quite easily create fieldtypes with their own specific schema, and Table is a fieldtype that pretty much does this for you, allowing you to define the schema via backend GUI. Overall I think it'd be much easier for us to understand your point, if you explained what the actual problem / difference is, instead of simply stating that "this doesn't exist" or "this can't be done with Pages". The thing is that we can keep arguing about whether pages can represent different content types for all week, but it's not going to get us anywhere unless we're on the same page about what it means first. Also, if it's something that can be easily achieved using tools we have now, I'd suggest that you consider alternatives -- there's always more than one way to do things. ProcessWire is very flexible, and one can achieve just about any structure using it, but sometimes you will have to let go of your "one true way to do this" approach and consider using what the system provides. If you're confident in your programming skills, you might also consider building a proof of concept. If that's the case, I'd probably start by taking a look at the Page.php (this is the Page we're talking about here) and WireData.php (the base data container in ProcessWire, which Page.php also extends). A lot of what ProcessWire currently does is based on the idea that "almost everything is a Page", so you'll probably have to do quite a bit of work to get around this, but there are other content types already (such as comments), and it's absolutely doable. If you do build such a proof of concept, please let me know -- always interested in seeing new ways to do things, as long as they provide some sort of real benefit7 points
-
Not so fast! Soma does this sometimes, and I've already seen a good amount of people thanking him for it. One could argue that it sounds rude —for an Atlantic person like me, so distant from the central Europe, it certainly does—, but the fact is that it's never only a personal opinion, as it always reflects the thoughts of more people. I know this is not a forum about CMS Critic, but since CMS Critic is so related to PW in some aspects, it makes all the sense to comment. Mike, you made your choices, and I'm sure you balanced very well all the aspects of your website. I have to say that I inevitably share Soma's concerns, It's not that I lost interest, as I still check the website from time to time, but it does feel a bit overwhelming, with lots of things happening at the same time and divided into so many sections. Also I noticed that there is lots of repetition in your tweets, and because I tend to not ignore your posts, yes, It can get a bit annoying. This doesn't erase all the merits, but does fade them a bit away. See? Soma can be much more straightforward them me, and we still haven't seen Joss's answer that will certainly come, he must be writing it for half hour already6 points
-
The reason for this is that you are setting the divisor and the probability after the execution of the garbage collector has already been decided (in other words, after the execution of session_start()). With Ubuntu your default value for the probability is 0, meaning it will never execute. You need to place those ini_set directives before the session is started. In ProcessWire one way to do this would be wire()->addHookBefore("Session::init", function() { ini_set('session.gc_probability', 1); ini_set('session.gc_divisor', 100); }); You would need to place this inside an autoloading module though. Another way would be setting those inside your .htaccess with php_value session.gc_divisor 100 php_value session.gc_probability 1 (depending on your host, this might not work) Your last resort would be clearing them "manually" by adding this to your _init.php. Well basically you wouldn't even need a hook, you could just execute the code. wire()->addHookAfter("ProcessPageView::finished", function() { $prob = ini_get('session.gc_probability'); $div = ini_get('session.gc_divisor'); $path = ini_get('session.save_path'); $expire = ini_get('session.gc_maxlifetime'); if(rand(1,$div) <= $prob)) { foreach(glob($path.DIRECTORY_SEPARATOR."sess_*") as $file) { if(filemtime($file) <= time() - $expire) unlink($file); } } });5 points
-
Do you have any constructive criticism on how we can improve this then rather than just telling me you lost interest in our site? We work hard to push products such as PW so I find that a bit insulting to be honest. I do have to pay the bills you realize so if there's a way we can improve it, do tell. I'm open to suggestions.5 points
-
FieldtypePageWithDate & InputfieldPageWithDate Module for ProcessWire - Page Reference with Date Field - Field that stores one or more references to ProcessWire pages Modified version of the FieldtypePage module in ProcessWire with extra datetime field containing the date a page was added to the inputfield. Github URL Link: FieldtypePageWithDate To install Copy to /site/modules/ and go to Admin > Modules > Check for new modules. Requirement Requires: InputfieldPageWithDate (will be installed automaticly) Tested on ProcessWire 2.5.6 dev Setup in back-end install both modules:FieldtypePageWithDate InputfieldPageWithDate create a new field in ProcessWire and give it a nameeg. myfriends as type choose PageWithDate choose the right dereference for your needs (all 3 modes work fine with this field)Multiple pages (PageArray) (in this example we are using this) Single page (Page) or boolean false when none selected Single page (Page) or empty page (NullPage) when none selected assign a selector to the field, in this example we will use users Template of selectable page(s) (select the user template) choose a label field, since we are using users set it to name Label Field name set an input field type, depending if you are using dereference of multiple or a single pagefor this example we are using AsmSelect save the field and assign it to a template of choice Add some users/friends to the field by editing a page with this template Usage in front-end In you template you can acces the field as you usualy do with any FieldtypePage. In addition to this the new parameter "assigned" is available Multiple pages if (count($page->myfriends)) { foreach($page->myfriends as $friend) { echo "id: ".$friend->id."<br>"; echo "name: ".$friend->name."<br>"; echo "assigned on: ".$friend->assigned."<br><br>"; } } This will output something like: id: 1031 name: johndoe assigned on: 2014-10-31 14:22:02 id: 1032 name: janedoe assigned on: 2013-04-15 23:16:38 Note: To use your own data/time formatting set $friend->of(false); to get a unix timestamp from the database Single page echo "id: ".$page->myfriends->id."<br>"; echo "name: ".$page->myfriends->name."<br>"; echo "assigned on: ".$page->myfriends->assigned."<br>";This will output something like: id: 1031 name: johndoe assigned on: 2014-10-31 14:22:02 Note: To use your own data/time formatting set $page->myfriends->of(false); to get a unix timestamp from the database Edited: removed extra date() formatting since value is formatted by default. Set assigned datetime manuallyYou can set datetime manually by assigning it to the page you add $friend = $users->get('johndoe'); $friend->assigned = "2012-01-01 12:12:12"; $page->myfriends->add($friend); $page->of(false); $page->save(); Edited: Added information on manually setting the assigned to a datetime value. (if you previously installed this module you need to update atleast the FieldtypePageWithDate.module file)4 points
-
4 points
-
I have to say Joomla is making really good effort not to loose its position in the big 3. They rebranded, moved to github, started to redesign code to be more modular. Maybe they deserve it this year. And yes, this the known flaw of democracy, as crazy commies from the place where I live not so long ago, and Plato a little earlier warned us about .4 points
-
A page that identifies it self as an image. There's no browser in the world that thinks this is a page. A template is a Page factory, what you produce in that factory is up-to-you. Don't be fooled by the word Page as others allready mentioned.4 points
-
@Zenophebe You can call it a 'mish mash', if you like, but that's not what it is. Let's be plain about this, and compare to a CMS like Bolt, which I use for some projects. Where you have your content-type definition in Bolt (which is defined in a YML file), you declare all the fields and options for that content-type. In PW, the same can be said of templates, only it's much easier to accomplish, and has support for an infinite hierarchy. So, templates are your content-type definitions, and Pages can be based on any of these templates, and can be put anywhere you like. What makes this not a 'mish mash', as that it allows you huge flexibility. I don't think I fully understand this... Why would creating a child page create a content type? If you create a 'products' template (that lists child products), you can then set rules (Family tab) on it that only allow the creation of pages based on the single 'single_product' template as children - this creates your 'product data'. Once again, I draw back to flexibility. PW doesn't force anything on you. You need to fully grasp the concept of how PW works before you can fully understand, and make good use of, it's flexibility. From a CMS point-of-view, it allows you to do almost anything.4 points
-
TextformatterMakeLinks This Textformatter module is just a wrapper around the method fHTML::makeLinks from flourishlib (http://flourishlib.com/api/fHTML#makeLinks) The following description is basically just slightly modified copy from the official flourishlib documetation (http://flourishlib.com/docs/fHTML): The Textformatter will parse through a string and create HTML links out of anything that resembles a URL or email address, as long as it is not already part of an tag. Here is an example of it in action: If you put this text into a textarea inputfield which uses this textformatter Example 1: www.example.com. Example 2: https://example.com.'>https://example.com. Example 3: john@example.com. Example 4: ftp://john:password@example.com.'>ftp://john:password@example.com. Example 5: www.example.co.uk. Example 6: john@example.co.uk. Example 7: <a href="http://example.com">http://example.com</a>. The output would be: Example 1: <a href="http://www.example.com">www.example.com</a>. Example 2: <a href="https://example.com">https://example.com</a>. Example 3: <a href="mailto:john@example.com">john@example.com</a>. Example 4: <a href="ftp://john:password@example.com">ftp://john:password@example.com</a>. Example 5: <a href="http://www.example.co.uk">www.example.co.uk</a>. Example 6: <a href="mailto:john@example.co.uk">john@example.co.uk</a>. Example 7: <a href="http://example.com">http://example.com</a>. Downloadhttps://github.com/phlppschrr/TextformatterMakeLinks http://modules.processwire.com/modules/textformatter-make-links/3 points
-
Not. https://www.cmscritic.com/2014-best-open-source-php-cms/ Best? Rather the largest community that voted. How comes there's devs that think it is the best? How comes I don't care.3 points
-
Let's not jump the gun and start saying they don't deserve it. They fought hard for it and won. Fair is fair when it comes to voting like this. That's why I did the Critics' Choice part of the awards well. To ensure that there are two opportunities (one where voting numbers doesn't count) for projects to get their deserved recognition.3 points
-
Phillipp, the website has around 10,000 sessions per month, 5 pages per visitor and 4 minutes / average session duration. By the way, minimize.pw is very simple and really helpful. I'm proud of the speed of the website thanks to minimize, proCache and AIOM. Take a look of the minimize stats: Images sent 500 Traffic In 225 MB Traffic Out 53.8 MB Saved 171 MB Compression 76.1%2 points
-
@cmscritic - I really hope you get some great feedback here and CMS Critic becomes even better as a result. Much respect for the website and the amount of energy and commitment it must take to make it fly. That CMSCritic is built on PW and you gave a wonderful case study is even better The problem for me when I visit CMS Critic is that I want to read some content yet the advertising is constantly fighting for my attention. As a result, I rarely visit and when I do, I rarely hang around and browse. I literally don't know where to look as the nice design and visual hierarchy of content is overtaken by shouty Ads. By chance I came across this site earlier and immediatley thought of your problem. I noticed how the three navigation, advertising and content columns are handled differently and wondered if it was an option. http://www.1stwebdesigner.com/tutorials/custom-php-contact-forms/ Because the advertising column on the right (on a desktop) has that nice light grey background, there's a subtle but effective distincition between the advertising and the content. Since the content is on the white background, I immediately understand that this is where my attention should be. I don't have to think about it - it's just intuitive and actually, the advertsing doesn't bother me as much. Anywho, I'm not looking to make more for anyone but maybe this is something useful.2 points
-
For the record, this bothered me too. I get that many (most?) of your potential advertisers are CMS companies because you write about CMS', but.. if you ever write a positive review about a product that simultaneously pays you, even for something entirely unrelated, it's a bit like a politician voting "yay" on a law that benefits a large company while being connected with said company: even if it's honestly and purely innocent, it's going to send the wrong message. We're not the ones you need to convince about your impartiality, but that's just how it works. Making it very clear that you're only allowing these companies to advertise on your site and have absolutely no connections to them otherwise might just be the only thing you can do to "fix" this, though. The worst thing you could do would be calling them your "sponsors" (which seems quite common these days), but luckily you don't seem to do that As a bit of positive feedback, there's one thing you're doing absolutely right: so far I haven't seen a single paid or sponsored tweet on your Twitter timeline. My tolerance for paid content on Twitter is pretty close to zero -- in fact I recently unfollowed A List Apart because these days considerable amount (probably 10% or less, but still) of their tweets are spammy sponsor messages. Don't care how important they are, they're not that important.2 points
-
@cmscritic Thanks for being open to feedback, even criticism, Mike. I like that! And thank you for your backing of PW too! <reminiscence> This topic reminds me of the time I shared a house with a bunch of Spanish post-grad students here in the UK. All 13 of us had communal meals and shared the dining table and house duties. Being a reserved Brit, however, I'd been brought up with one conversation at a time at the dining table - and you could join in or not as you wished. In the student house there were always, what seemed to me to be, six concurrent arguments going on; usually about football. As I got used to this, I realised that they weren't arguments - just good-natured, frank, conversations: with the volume cranked way up. I've seldom met a group of guys who were so community minded, cheerful, helpful and well organised yet their neighbours lived in fear of them through incorrect perception which seemed to equate their being foriegn and loud with aggression/unfriendliness. </reminiscence>2 points
-
Adrian, Tom - Indeed, it will support that, quite fully. It would be a case of directing /programs/{program:segment} to /about/programs/{program}. I'm sure it'll be ready by the time you need it, Adrian. I worked on a bit yesterday (importing). I have exporting on the to-do list, but I wonder how necessary it is. I may just leave it out, until someone needs it. Or perhaps we put it to a vote, or discuss further. Anyways, by the end of next month, I'd like to have a beta put up. I know it sounds like a long way away, but I assure you, if I had time on my hands, this module would be finished by Friday next week, if not sooner. Edit: I need to get everyone first names right! Hehe!2 points
-
2 points
-
2 points
-
2 points
-
2 points
-
Silence is golden! Let's close the forums! I guess that we have all the human rights here to spit a little acid about all the other CMSs and the sites that let them win over us! Even if they are those that let us win over them in the past. Arghh? I am just kidding and want to make it explicit. CmsCritic is "cool" as it brought me to Processwire. And it is half full of banners. I sometimes use this site to demonstrate my clients what are sidebar banners and how they could look (and that is no kidding). So CmsCritic is "cool" anyway: as a way to opensource world and as a online banner ad demo . I think that we really should be more tolerant to untolerance because that is the greatest tolerance there is and the way to freedom of thought . Let's keep this as ironic as it gets and spill no blood here.2 points
-
That proverb we don't know. It's the opposite here. I say nothing if I'm happy, and it's urgent and important to say something that you don't like. Anyway sorry that I said something.2 points
-
Thank you for clarifying but there's that age old adage, if you don't have anything nice to say, don't say anything at all. Perhaps simply not saying anything at all might have been more polite than saying you lost interest in someones work is my point. It had nothing to do with the conversation and therefore, was unnecessary.2 points
-
Foundation (and Bootstrap) don't really care what CMS you use once you can adhere to their CSS. Likewise, a good CMS such as PW doesn't care what responsive framework you choose either. Customer reviews Is that currently a WordPress widget which then pulls in the G+ reviews? social share Have you looked at some of the off-the-shelf social widgets such as http://www.addthis.com/ ?2 points
-
Unless you can point to some agreed/standard web terminology, content type seems mainly to be a Drupal concept (OK, so there's also SharePoint but that's another story). It's just one way of organising and 'naming' content. MODx has resources, Drupal has nodes/content types (of which a 'basic page' is but one type), here we mainly organise our content using 'pages'. There's no right or wrong way....that's just the way it is. But we do like our 'pages'2 points
-
I think you are misunderstanding how ProcessWire works. The reason Drupal has content types is because they welded a CCK on top of the system as an after thought. ProcessWire has no such restrictions. You create dedicated templates for everything. You want a review page? You create a template for it. You want an event page? Create a different template - and so on and so forth. In fact, you HAVE to do that - the blank install has nothing in it. It is a blank sheet of paper for you to play with. Systems like Joomla and Wordpress are not really Content Management Systems - they are Article Management Systems which have to be bent to work with different types of content. ProcessWire is a true content management system in that is manages any kind of content that you want to create. Pages, as I said before, are whatever you want them to be. They are not a limited thing like the mainstream Drumlapress. They are just what you create from whatever template you design.2 points
-
Yes, two minutes ago! Adrian went into the Lightning site and all it was that my post page foreach statement was in the articles template. It should have been in the template that functions for the hidden posts container page that stores the actual articles. Now that I look at this it becomes so obvious. But I spent so much time on this without thinking of this. Hopefully a lesson learned. I hope this thread might serve some other new kid someday... One other thing: I have a working gallery system on this Lightning site. The thumbnails do not show but they do on my localist install that uses the same everything. What do I look for to fix this? Or should I ignore it and track it down when I upload the real live version of this site in the next few days. This will be my first live PW site... Again, thanks to all who contributed so much here...2 points
-
If you’re able to take a little time to learn basic HTML and PHP, I think ProcessWire will be a great choice for you. It is very beginner friendly in that sense. However, if you want to pick a ready made template and only add your own content, you will find the wealth of options much greater with other systems.There are so called site profiles for ProcessWire, which provide you with a ready-to-go starting point for your site. You can choose one during the installation. They’re a great resource for learning how to work with ProcessWire. Just open one of the template files and have a look. The thing is that HTML/CSS and PHP are entirely independent of ProcessWire, which is why you probably won’t find tutorials that teach you both at the same time. Your best bet will be to learn at least basic HTML and CSS from an independent resource (there are plenty in every possible format and medium). I wouldn’t bother with PHP and webservers just yet. In fact you can probably take your first PHP steps directly with ProcessWire. But HTML is pretty much a requirement first. After all, you will use PHP to generate HTML code. Just don’t be scared and start simple. Create a text file on your local computer and start copying some HTML tutorials.2 points
-
I'd like to share and discuss some things I've come across maintaining the German translation. Ryan has outlined a way to get the translatable files in PW: http://processwire.c...__20#entry11232 — while this does work, it's not very comfortable. It would make translations much easier if there was a way to get those in the backend, as well as maybe detect which translatable files are new or abandoned. For instance, I think InputfieldRadiobuttons just got moved to a separate directory, making the previous translation file uneditable. I think it would also be good to have different "states" for empty fields in translations. As of now, "empty" could mean "not translated yet" as well as "doesn't require translation, can fall back to English value". Updating a translation would be easier if one could just skip the values which don't need to be translated, but obviously, this would be nice to have. It's definitely not a must-have. Which brings up the question as to when to actually update a translation. Obviously, doing that constantly as changes are committed to GitHub is insane. So it would make sense to update translations based on a release. As far as I have followed PW development, there is no alpha/beta stage, right? It would be nice to have some phase before a release where nothing new is added so translations could be updated to be ready along with a new release. Another thought: Let's say I install a translation for PW 2.3 in a PW 2.2 installation (or vice versa). Are there going to be any "side effects"? Should we maintain versions of the translations for specific PW releases? Most pressing issue in my humble opinion: currently (as far as I can see, please correct me if I'm wrong), there's no "protection" for additional translations added. Let's say I install a translation, then I add some translations of my own, maybe related to the templates of the site or some help texts in the descriptions of fields. Then I update PW and the updated installation. In that case, all my additional translations will be overwritten by the updated translation, right? If so, there should at least be a way to backup the additional translations, although I figure this could be hard to implement given the JSON format of the translations. Oh boy. Sorry for rambling here, I hope this makes some sense.1 point
-
I didn't notice any ads as I use Adblock plus . Just switched it off to have a look. woooooooooooooo that was quite a shock. Maybe you could please more of us if you had some kind of game on the page that gives those of us that don't like the ads an opportunity to shoot at the banners and destroy them before reading an article. I think my first shot would be at weebly side banner.1 point
-
Adrian, you are probably correct on the semantic aspect. I will try adding the <ul> back. This will mean adding the <li>s as well, but that will be a good exercise for me. I really need to practice how to write these php code blocks in my templates. I am slowly getting it though... I have done a bunch since you checked out the site. I am back working locally again. Hope to take this live in the next couple of days ( I have a ton of photography (shooting eyeglasses) to do this weekend)...1 point
-
Riz, it took me a while to get things going. Here's the (working) code I use on my home template: // MAP echo "<div style = 'width:85%'><br>"; $landmarks = $pages->find("parent=/events/|/the-eyes/, bfd_month.name=$month, bfd_day.name=$day, sort=bfd_day, sort=bfd_year, sort=name"); $markers = new PageArray(); foreach($landmarks as $landmark) { $myentry = $landmark->bfd_events_places_id_list; $myentry->markerUrl = $landmark->url; $myentry->markerTitle = $landmark->title; $markers->add($myentry); } if ($markers && $landmark->bfd_day) { $map = $modules->get('MarkupGoogleMap'); $options = array('width' => '100%', 'height' => '500px', 'markerLinkField' => 'markerUrl', 'markerTitleField' => 'markerTitle'); echo $map->render($markers, 'MapMarker', $options); } else { echo ""; }; ?> </div> "bfd_events_places_id_list" is a page field in every "event" template. It refers to pages that have the actual MapMarker field and other info as well (placename, street, district, city, state, country,...). Maybe you can adapt it to your situation. And probably some guys here can smooth it all out or compact it. DDV1 point
-
Yeah, I've been trying to "figure it out" for 2 days... EDIT: Okay, I got it! The problem is that I was using display: flex; on the body element, which was also getting imported into my contents.css file. I changed this to display: block; and we're good to go.1 point
-
ah, have to re-read before answer! Please, what code do you use in image() ?? Heureka! Ok, now I have it! $membre->professionnel_photo is a collection (Pageimages), but it should be a single Pageimage!1 point
-
New FormHelper dev branch 0.0.7 removed hardcoded allowed file extensions (forgotten test string...) changed jsconfig handling (now js-code is prepended to $config->scripts I thinking about a honeypot feature to make forms (more) "secure" against bots... What do you think? Would it be a good idea? https://processwire.com/talk/topic/2089-create-simple-forms-using-api/?p=41795 A field hidden by CSS | by JavaScript A field requiring a blank input A field requiring a specific input1 point
-
Thanks for giving my module a try. I see that it would be handy in your case, but I think it's better to keep these Textformatters separate. Not everybody wants obfuscation, and having separate Formatters is way more flexible.1 point
-
I don't think it's bias. Actually, knowing cmscritic I'm sure it's not. I'm not even saying that it's incorrect, just analysing what new visitors might feel.1 point
-
It's good to see @cmscritic taking this stance with the community. Both he and Ryan are role models for others. They take care of their community. Treat them well. Listen to what they have to say. It brings comfort to me knowing that I too, can voice my opinion on something and not be ignored, but listened to. [ROUND OF APPLAUSE]1 point
-
Why do you feel that it's not the way you should be doing it? The only case where I think there could be a cleaner way is if you only wanted to print a comma separated list of the titles of the items inside the Page-fields. Then you could do <h4>Course Details</h4> <strong>Level:</strong> <?= $page->course_detail_level->implode(", ", "title"); ?><br /> <strong>Category:</strong> <?= $page->course_detail_category->implode(", ", "title"); ?><br /> <strong>Grouping:</strong> <?= $page->course_detail_grouping->implode(", ", "title"); ?><br /> Otherwise, just stick with the loops1 point
-
1 point
-
You could have just appended a string, e.g. 'panel' to every id then ...Nice and short rather than using names...not that the browser cares anyway . But it works, that's what's important...1 point
-
Great topic! And really nice to see that everything that has been outlined and planned got its way into reality. I am trying to update russian translation right now and find it difficult to find the file with the string I want to translate. Am I completely missing the search and find capability, or is it not in place? If it is really not there, I think it would be great enhancement to find translatable string by text in default language.1 point
-
Hi Stefan, The repeater field is PageArray holding pages. I'm not sure if a repeater can contain another repeater, if it's possible this wouldn't be a good idea in my opinion Extract your logic into a function that can be called recursive, this is just an example written in the browser, not tested: function setLanguageValue(Page $p, $language) { $pageFields = $p->fields; // iterate through all fields of the given page foreach ($pageFields as $field) { $type = $field->type; // only select a field if it is translatable if ($type == "FieldtypeTextLanguage" || $type == "FieldtypeTextareaLanguage") { $p->setLanguageValue($language, $field->name, "some dummy text"); } elseif ($type == "FieldtypeRepeater") { // Go recursive here $repeaterFieldName = $field->name; foreach ($p->$repeaterFieldName as $subpage) { setLanguageValue($subpage, $language); } } } $p->save(); } // Execute it $startPage = wire('pages')->get("/"); $russian = wire('languages')->get("ru"); setLanguageValue($startPage, $russian);1 point
-
Couldn't this be done with this Textformatter afterwards? http://modules.processwire.com/modules/email-obfuscation/1 point
-
Hi Wanze, I figured it out, this is a silly mistake of not supplying the correct path LOL! <?php //we use the page title as template $template = $sanitizer->name($page->title); /* render load body */ $body = $factory->load('custom-templates/' . $template. '.php'); if ($config->ajax) { $view = $factory->load('_Ajax.php', true); } /* render custom-templates */ $view->set('Body', $body->render()); So, I am rendering the body with the global template option and if there is an ajax request, the global template is overridden with ajax.php or empty template using $factory->load() Silly mistakes!1 point
-
I'd forget about incrementing anything...you already have unique numbers in page->id. Use faq->id and problem sorted, unless for some other reasons you need to start from 1....1 point
-
Hi i just finished website that i build on processwire. Im a frontend developer and noob with php. But with processwire i managed to build this site, so i want to thank you for giving us such a great tool for building websites. Here is website in Polish, and in a month or so i will release english version of the site. http://hejtuje.com english version will be avaible in here : http://hate.it Some feedback would be nice . Thanks PW!.1 point
-
Another way you can go is to use page reference fields. Add two new 'Page' reference fields: topnav and footnav. Make them support multiple pages. Don't restrict it to a parent or template. Select 'PageListSelectMultiple' as the Inputfield for them. Save, and add them to your Homepage template. Now edit your homepage. For the 'topnav' field, select all the pages you want as part of your top navigation, and for the 'footnav' field select all the pages that should appear in your footer navigation. Drag to sort them in the order you want. Edit your main markup file (or head/foot includes) and use the following code to output that navigation: <?php foreach($pages->get("/")->topnav as $item) { echo "<li><a href='{$item->url}'>{$item->title}</a></li>"; } …repeat the same for the footer nav, except iterate the footnav (rather than topnav) field. In the sites that I develop, I almost always have the footer nav hard coded in the main markup file (I don't usually need it to be dynamic). For when I need the topnav dynamic, I'm usually sticking to the site's root level structure for the navigation (iterating the non-hidden children of the homepage). You may need all this stuff to be dynamic, in which case there are a lot of options. But I just wanted to mention that you should only make stuff dynamic that needs to be. When stuff can be hard coded in a template file, it consumes fewer resources. So if you stick to a policy of hard coding stuff that changes rarely and doesn't need to be dynamic, then you'll benefit from better performance, use less energy, save more trees, etc.1 point