-
Posts
1,011 -
Joined
-
Last visited
-
Days Won
8
Everything posted by SiNNuT
-
-
... snip ... Recently a client proposed rolling out a site and I am evaluating PWs suitability as the underlying site. Here are some features: Membership with potential for ten of thousands of members. User Groups and sign up forms adding users to particular groups. Vast amount of pages with ability to organise and search pages ( via backend) Paid membership PW definitely fits the bill. All the elements are there to build upon. There will be building/programming involved, because (some) of the features don't come out of the box, or in a module. You would have to do work on the (paid) subscription part. Probably some front-end login areas etc. All very doable and perfect for PW with it's nice architecture and API. But it does take some time to invest and the willingness to learn some PHP (which is never a bad thing). If you are looking for some more out of the box experience there are also other options. What concerns me about PW is how the CMS will handle such a huge number of pages as it uses the resource tree concept. Some dabbling with Expression Engine made me appreciate the 'bucket' data model where an entry didn't have to be a page. I hope that makes sense. Information was stored in Channels, were very scalable and manageable too. Ironically, I never got to grips with EE fully and moved on to MODX. My usage of PW will not be a switch from MODX but I am keen not to learn another CMS with a potential resource tree shortcoming. Possibly someone gets what I am saying? Just how scalable is PW and do I need to learn PHP? There already have been some great answers on this but i just wanted to mention that it is very possible to have an 'alternative' view on your data. Something like http://modules.processwire.com/modules/data-table/ Just thought i'd mention it. As for your question, "should i make friends with PW?" Definitely! It's one of the greatest all-round content management systems/frameworks.
-
I'm not sure but if your $booking->timestamp field is of the type datetime shouldn't you convert the timestamp value to a Y-m-d H:i:s date string before saving?
-
Is there any way to execute PHP loaded from textarea fields?
SiNNuT replied to DZoneRick's topic in API & Templates
I don't see why not. Mind you, i haven't actually used Nico's module so if you have questions post them in the corresponding module thread. -
Is there any way to execute PHP loaded from textarea fields?
SiNNuT replied to DZoneRick's topic in API & Templates
Ok, this thread has gotten a little bit out of control in regards to the original question and where it went from there. It's not even about the possibility of putting PHP into text(area) fields perse, but the ability to use variables or tags inside text fields. In your example something for $config->urls->templates. Like Soma said: "Pw has no template tag language and will never have in core level. However this is an easy task and would make a simple textformatter module. Basicly what wanze does but more convenient." I was thinking you could maybe use http://processwire.com/talk/topic/1819-markupshortcodes/ to map $config->urls->templates to [urltemplates]. Then you could just use [urltemplates] anywhere in text fields of your choosing. The sky is the limit, you can define as many tags as you like representing every combination of php/js/html you wish. -
Is there any way to execute PHP loaded from textarea fields?
SiNNuT replied to DZoneRick's topic in API & Templates
If I am writing a journal entry I may want to write a paragraph, insert an image inline with the text, write another paragraph and embed a Youtube video. I don't want to create a new page type with a text field or two, an images field, a movie field and a template to put them all together. I just want to sandwich some html markup with a header and a footer and move on. There would be nothing stopping you from doing so with any text area field with tinymce turned on. Images added to the page become available in tinymce/rich text via the 'Select Image' button. You can also choose from different pages. By default the tinymce configuration is fairly bare-bones but you can change this to the point where it is a ms word clone. Not 100% sure about youtube stuff but you can prolly just insert the embed code where you want. Ryan is also working on a CKEditor implementation which may be of interest to you. Even if you load the images in a journal entry into the images field of a typical page template, how are you supposed to access them from within your rich text or markup?... see the above One of my competitors is Salesforce's Desk.com, and they have an outrageously good sales website. A site like this would be really tough to develop in ProcessWire since almost everything on the site is handcrafted, single-use content. Not much of their site is well-suited for templates, but the whole thing is pixel perfect. There's a place in the world for content that isn't generated by invoking a template on a set of page data. I don't see anything on that site (which is indeed nice) that would be particularly tough to do in PW. In fact, it would suit PW well i think. When you say "Not much of their site is well-suited for templates, but the whole thing is pixel perfect." i don't understand. How do templates and fields relate to a design and layout being pixel perfect? In essence the desk.com site is a well executed Twitter Bootstrap site and i'm guessing that they have structured their content well in the backend. Or maybe it's just handwritten html, who knows. ProcessWire is an awesome tool, but not all content is so rigidly aimed at separation into data and templates. Some content is just content, use it once and keep moving. Lots of other CMS's make that easy, but they don't excel at the structured repetitive stuff like ProcessWire does. It would be great if ProcessWire also made it easier to produce those conventional throwaway pages, too. I'm not saying that PW is perfect. Some things take getting used to, others could be improved upon and surely there are other systems out there that do a better job at a certain content management aspect. What i don't see is that PW makes it particularly hard to create content, throwaway pages, or otherwise. -
Repeater Items - How to filter "ready items" - Bug?
SiNNuT replied to Luke Solar's topic in API & Templates
I think i can at least shed some light on where status 3073 is coming from in the DB. If you take a a look at Page.php (in the wire/core folder) you see this: /* * The following constant flags are specific to a Page's 'status' field. A page can have 1 or more flags using bitwise logic. * Status levels 1024 and above are excluded from search by the core. Status levels 16384 and above are runtime only and not * stored in the DB unless for logging or page history. * * If the under 1024 status flags are expanded in the future, it must be ensured that the combined value of the searchable flags * never exceeds 1024, otherwise issues in Pages::find() will need to be considered. * * The status levels 16384 and above can safely be changed as needed as they are runtime only. * */ const statusOn = 1; // base status for all pages const statusLocked = 4; // page locked for changes. Not enforced by the core, but checked by Process modules. const statusSystemID = 8; // page is for the system and may not be deleted or have it's id changed (everything else, okay) const statusSystem = 16; // page is for the system and may not be deleted or have it's id, name, template or parent changed const statusHidden = 1024; // page is excluded selector methods like $pages->find() and $page->children() unless status is specified, like "status&1" const statusUnpublished = 2048; // page is not published and is not renderable. const statusTrash = 8192; // page is in the trash const statusDeleted = 16384; // page is deleted (runtime only) const statusSystemOverride = 32768; // page is in a state where system flags may be overridden const statusCorrupted = 131072; // page was corrupted at runtime and is NOT saveable: see setFieldValue() and $outputFormatting. (runtime) const statusMax = 9999999; // number to use for max status comparisons, runtime only So i think 3073 comes from the combined values of statusOn, statusHidden and statusUnpublished. One would assume that pages, like readypages, with a code > 1024 would be excluded by default in finding and listing repeater items. I have looked through the FieldtypeRepeater code to see what's going on but this is beyond my php skills and knowledge of the core system. Maybe Ryan can comment on this. For the moment i think your filter solution seems fine. I you want to read more on status stuff i suggest you do a 'find in files' for 'status'. Tools like Sublime Text then give a nice overview of the search results. Not really slick docs..but good for learning :) -
Like you already mentioned page names can only be standard alphanumeric and dash, underscore and dot. What exactly is your question? InputfieldPageName attempts a character replacement. Maybe your character (which is it?) isn't listed? You can look this up if you go to Modules->Page Name (under the Inputfield section) and click on it. You should see a whole list, to which you can add your own if neccesary.
-
Is there any way to execute PHP loaded from textarea fields?
SiNNuT replied to DZoneRick's topic in API & Templates
This is not an answer to your question but couldn't you just add a checkbox field to the templates you desire and just check for that in your footer.inc? pseudo: if page->loadextrastuff is checked load extra stuff code Allowing php code to be executed from user generated content/input sounds horrible. -
I'm not sure that i understand your question but what's the problem with just ftp'ing the files to your serv.
-
Can i ask why exactly you want to omit certain url parts? Is it purely aesthetic or are there other reasons. Also, a product can only ever belong to 1 vendor? If not, you should choose Pete's suggestion. The thread you where looking for is this one i think: http://processwire.com/talk/topic/1799-routes-and-rewriting-urls/
-
It sure does sound cool. If i understand you correctly maybe the whole 'visual' part (clicking together a query with checkboxes, sliders etc.?) could be added on top of a module like this: http://processwire.com/talk/topic/1859-module-testrun-selectors-find-from-admin-processselectortest/
-
There's also http://www.google.com/webfonts
-
I think there's something to be said for the 'unpublished' option. If you look at this setting in the admin it says: 'Unpublished: Not visible on site'. It seems this is exactly what you want. Surely this can't be hard to explain to clients: "we keep faq items unpublished because we don't want them individually accessible on the website". Another option is a variation on 4: instead of trying to do this in robots.txt you can put <meta name="robots" content="noindex, nofollow"> in the head section of your faq template. This way you also keep spiders out and and it automaticaly applies to all pages using the faq template. Of course, they still would be url accessible but you wouldn't link to them on the site, nor would google index them, so no real problem. Just in case someone would visit a faq url you could make clear what's happening via the template output: "notice: this page is part of .... visit this page instead (link)"
-
I don't know Piwik, but glancing over their API documentation it seems fairly simple to grab and display to the data you want on the site. This would be more robust and flexible i think plus it would allow, as Ryan already mentioned, use in a cached environment.
-
Hi FvG. If i'm correct PW has already implemented this, at least in the more current dev versions. If available it uses bcrypt hashing, which is one of the strongest. Some inspiration is also taken from the library you mentioned. Have a look through Password.php to see what's going on.
-
i think so, from the docs:
-
I haven't done much front-end user stuff but the API and flexible role/permission/user system makes this pretty easy. Of course, depending on the exact needs it could get more complex. So for example you could create a new permission called frontend-edit. Create a role called frontend-editor and give it page-view and frontend-edit permissions. This will keep a user with (only) the role frontend-editor out of the back-end but allows you to log him and check for permissions in templates, allowing stuff you want. if ($user->hasPermission("frontend-edit")) { echo "<a href='{$page->url}edit'>EDIT</a>"; } else { echo "you are not logged in or you do not have permission to edit this page"; } if ($user->isLoggedin()) { echo "here you go, view this awesome page"; } else { echo "plz login if you wish to view this awesome page"; A front-end login could be as simple as creating a page, why not name it login, and putting this into the template file: <?php /** * Login template * Based on a forum contribution by Ryan, can't locate it, but the are many examples of login forms. * */ if($user->isLoggedin()) { // user is already logged in, so they don't need to be here $session->redirect($config->urls->root); } // check for login before outputting markup if($input->post->user && $input->post->pass) { $user = $sanitizer->username($input->post->user); $pass = $input->post->pass; if($session->login($user, $pass)) { // login successful $session->redirect($config->urls->root); } } include("./inc/head.inc"); ?> <?php if($input->post->user) echo "<div class='alert alert-error'>Vekeerde combinatie van gebruikersnaam en wachtwoord</div>"; ?> <form class="" action='./' method='post'> <label for="user">Gebruikersnaam</label> <input type="text" name="user" id="user" placeholder="Gebruikersnaam..."> <label for="pass">Wachtwoord</label> <input type="password" name="pass" id="pass" placeholder="Wachtwoord..."> <label></label> <button type="submit" name="submit" class="btn btn-primary">Login</button> </form> <?php include("./inc/foot.inc"); ?> These are just some examples but most if not all what you need is already available. It's up to you to code it the way you want. The API cheatsheet gives a nice overview of available building blocks. For the Create, Update and Delete stuff i think you would need to roll your own forms, populate them via the API and do with it what you want. Of course making sure you properly sanitize the inputs, maybe do some of your own validation etc.
-
First Year Programs at the University of Washington runs on ProcessWire!
SiNNuT replied to Jennifer S's topic in Showcase
Jennifer, had a quick look and it looks great. You seem to have a broken link on the homepage to the Calendar of Events. http://fyp.washington.edu/fyp/calendar-of-events/ . I guess it could do without the second 'fyp' -
you got it right christoph
-
Great module! You guys definately are not like Moose the Cat..
-
Why does $page->rootParent identify current section?
SiNNuT replied to isellsoap's topic in Getting Started
Darned, i could have fitted that in <140 characters But still, i managed to lure someone to the forums- 16 replies
-
- 3
-
-
- current section
- semantics
-
(and 2 more)
Tagged with:
-
I don't think the most popular article is always equal to the one with the highest number of page views. Which one is more popular?: the one viewed 50 times by 50 unique visitors or the one viewed 51 times by 40 unique visitors.
-
Why does $page->rootParent identify current section?
SiNNuT replied to isellsoap's topic in Getting Started
Hi there, and welcome to the forums. The code snippet above grabs all the children of Home (/). If 'Home' is level 0, it's children are level 1. The code then adds Home to the foreach of level 1 with $children->prepend($homepage); This level 1 pages are rootParents. So it does: for each level 1(rootParent) page that is found output this list element in the navigation: Home About (let's say you are on the about page, then: current page equals (===) rootParent, so mark me with class='on' Projects $homepage = $pages->get("/"); $rootParents = $homepage->children; $rootParents->prepend($homepage); foreach($rootParents as $rp) { $class = $rp === $page->rootParent ? " class='on'" : ''; echo "<li><a$class href='{$rp->url}'>{$rp->title}</a></li>"; }- 16 replies
-
- current section
- semantics
-
(and 2 more)
Tagged with:
-
I'm no SEO expert but i can imagine there's some appeal to paginated blogposts/articles from this point of view. Personally i don't like it but that's from an end-user and usability perspective. It just seems so unnecessary and artificial in the web world to paginate stuff like this. Example: What if i wanted to print a paginated article? Native browser print is out of the window so you have to do some work to make a 'print this article' function. It just doesn't make a whole lot of sense. Anyway, your need is perfectly acceptable and you don't need to make a plea. I don't think there is a module doing this and i don't think you need it. Choice a solution, be it via <!–nextpage–> in the body html or maybe via repeaters and put the logic i the corresponding template file.