Leaderboard
Popular Content
Showing content with the highest reputation on 04/15/2014 in all areas
-
Loading content from 50 other pages should never take over 3 secs. Can you share the code you cached to see the original performance issue.4 points
-
Exact same reaction as you ankh2054 when I stumbled across PW (thanks to Marty Walker whose site I found and saw PW mentioned). I have not regretted or looked elsewhere since and I have actively re-built some sites from other CMSs to PW JUST for my own benefit. Welcome and enjoy!3 points
-
Hah u have nothing to sorry about , i thank you for your work and time . I downloaded newest version from gitbub and it works perfectly thank you again.2 points
-
Sorry about that - I just pushed a new version that supports grabbing the thumbnails when saving a page through the API as well. Let me know how it goes.2 points
-
I really liked this idea & added this setting, tnx for mentioning it @wanze It's splitted in 2 settings actually. 1. Specify the headers. 2. Start with table. This way it is possible to start with a table with or without the headers. If start with table is set, it prevents editors to see th CSV import. As in Europe (most countries) floats are divided with a comma and not divided with a point. As a result CSV data mostly use the semicolon as a delimiter. There's a setting to set the delimiter to comma semicolon or tab. In the Inputfield, the editor can upon CSV import choose which delimiter to use (by default inheriting the default setting). The force to integer setting, will recognise if the European float, and will convert this to normal float. ( heavy on CPU, so only check if needed ) @adrian, also added the ability to delete all data returning to the CSV import.2 points
-
I think you need to do some serious reading - this forum is too limited for your questions. There is no simple answer - for instance, the quality of the writing has a huge impact. You can fill your front page text full of key words which will help in your search engine placement, but if the writing is not good, people wont actually stick around to read the rest of your website. Thousands of visits is no good if you have 100% bounce rate. And as for blogs and so on - that is a huge subject!2 points
-
2 points
-
I think the issue is simply that this module requires the video link to be in a <p> tag. Take a look at the two functions in the module and you'll see what I mean. So you could just do this and I think it should work. if($videoUrl) { $np->video = '<p>'.$sanitizer->textarea($url).'</p>';}2 points
-
This module serves as an example of creating an editable table of data as a Fieldtype and Inputfield in ProcessWire. In this case, we create a simple table of events each with date, location and notes. This pattern can be adapted to nearly any table of information. Note that this module is intended as a proof-of-concept. If you find it useful for the example scenario (events) then great, but keep in mind it is not intended as a comprehensive events solution, where using ProcessWire pages may be a better fit. This is a pattern I've used for creating tables of data in ProcessWire for many different Fieldtypes/Inputfields and thought it would be good to setup a proof-of-concept example like this to share. Module Page / GitHub Page Install Copy the files for this module to /site/modules/FieldtypeEvents/ In admin: Modules > Check for new modules. Install Fieldtype > Events. Create a new field of type Events, and name it whatever you would like. In our examples we named it simply "events". Add the field to a template and edit a page using that template. Output A typical output case for this module would work like this: foreach($page->events as $event) { echo " <p> Date: $event->date<br /> Location: $event->location<br /> Notes: $event->notes </p> "; } This module provides a default rendering capability as well, so that you can also do this (below) and get about the same result as above: echo $page->events; ...or this: foreach($page->events as $event) { echo $event; } Finding events This fieldtype includes an indexed date field so that you can locate events by date or within a date range. // find all pages that have expired events $results = $pages->find("events.date<" . time()); // find all pages with events in January, 2014 $results = $pages->find("events.date>=2014-01-01, events.date<2014-02-01");1 point
-
A quick tutorial how to create file downloads using pages You will be able to create a new page using template "PDF" (or any you setup), upload a pdf file. You then can select this page using page fields, or links in Wysiwyg. The url will be to the page and NOT the file itself. This will allow to keep a readable permanent unique url (as you define it), unlike /site/assets/files/1239/download-1.pdf, and you'll be able to update/replace the uploaded file without worring about its filename. Further more the file will also have an id, the one of the page where it lives. Clicking those links will download or open the file (when target="_blank") like it would be a real file on server with a path like /downloads/project/yourfile.pdf. You'll be also able to use the "view" action directly in the page list tree to view the file. Further more you'll be able to esaily track downloads simply by adding a counter integer field to the template and increase it every time the page is viewed. Since the file is basicly a page. This all works very well and requires only minimal setup, no modules and best of it it works in the same way for multi-language fields: Just create the language alternative fields like "pdf, pdf_de, pdf_es" and it will work without modifying any code! Still with me? ok PW setup Download folder: Create a template "folder" or "download-folder" with only a title needed. Create pages in the root like /downloads/project/ using this template. Setup the template for the pdf files 1. Create a new template in PW. Name it pdf 2. Goto template -> URLs tab and set the URL end with slash to no. (So we can have /path/myfile.pdf as the URL) 3. Create a new custom file field, name it pdf. Set its maximal count to 1 under -> Details tab. 4. Add the pdf field created to the pdf template. Easy. 5. Create a new "pdf" page using the pdf template under a download folder you created earlier. 6. Give it the title and in the name field add ".pdf" to the end (could also leave as is) Template PHP file for the pdf files 1. Create the template file pdf.php in your /site/templates folder 2. add the following code: <?php // pdf.php if($page->pdf){ wireSendFile($page->pdf->filename); } Done. To see the options you have with PW's wireSendFile() you can also overwrite defaults <?php // pdf.php if($page->pdf){ $options = array( // boolean: halt program execution after file send 'exit' => true, // boolean|null: whether file should force download (null=let content-type header decide) 'forceDownload' => false, // string: filename you want the download to show on the user's computer, or blank to use existing. 'downloadFilename' => '', ); wireSendFile($page->pdf->filename, $options); } Simple and powerful isn't it? Try it out. Some thoughts advanced Create as many file types as you like. It might also be possible to use one "filedownload" template that isn't restricted to one field type but evaluate it when being output using $page->file->ext, or save the file extension to the page name after uploading using a hook. One last thing. You can add other meta fields or preview images to the template and use those to create lists or detail pages. It's all open to goodness. Again all without "coding" and third-party modules. Further more you can use the excellent TemplateDecorator to add icons per template and have a nice pdf icon for those pages. This as a base one could also easily create a simple admin page for mass uploading files in a simple manner, and create the pages for the files automaticly. ImagesManager work in the same way. Cheers1 point
-
HTML Purifier is an HTML sanitization and validation module for ProcessWire. It serves as a front-end to the HTML Purifier PHP library. From htmlpurifier.org: Usage: This module is something that you would use from a template file or another module. The syntax basically goes like this: $purifier = $modules->get('MarkupHTMLPurifier'); $cleanHTML = $purifier->purify($dirtyHTML); The default settings seem to be about right for most cases. However, you can also specify custom settings to HTML Purifier by performing set() calls before calling purify(). For example, UTF-8 encoding is assumed, so if you wanted ISO-8859-1 instead, you'd do: $purifier->set('Core.Encoding', 'ISO-8859-1'); About this module: The reason I made this module is that I'm currently working on a CKEditor module for ProcessWire. It supports a very nice inline mode that I'd like to use. But the problem with an inline mode is that the text you edit is real rendered HTML (rather than a textarea), so that could be a security problem (i.e. XSS). I researched into into how best to resolve that, and the HTML Purifier library kept coming up. So here this module is. The new CKEditor module will require it if you want to use inline mode. Download: GitHub: https://github.com/ryancramerdesign/MarkupHTMLPurifier Modules Directory: http://modules.processwire.com/modules/markup-htmlpurifier/1 point
-
Hi All, I am feeling very lucky at present stabling across processwire, it seems very powerful and sounds like it would scale much better than MODx. I wanted to to just ask a few questions before I make the move from MODx, so if anyone wants to be so kind:) Having no real PHP experience, albeit I can quite happily use PHP operators such as ==, != , if, else etc.... Would it be easy enough for someone like me to create the following elements: Registration, Login, logout processes and use profiles Ability for users to create pages Add a voting/polling buttons (yes/no) to user created pages thanks so much for the help. Charles1 point
-
I'm not sure about it to be honest (which probably goes against what I've said on the subject when it's been mentioned before ). I mean, the user will have just done some manual work to get the files onto their server to begin installation anyway (even if they use the single file installation method) so it shouldn't be too daunting for them to put a different profile in the right place. What might not be a bad idea as a first step towards this is maybe mention on the first step of the installer that other profiles are available with a link to them?1 point
-
This might be a dead topic, but I'm looking at doing an implementation using Google Analytics (GA) API to do that on a website that has caching (and don't want to create too much custom cache code that I'll have to maintain afterwards), using a cron job. I looked at the documentation, and tried a few things with GA's Query Explorer : http://ga-dev-tools.appspot.com/explorer/ https://www.googleapis.com/analytics/v3/data/ga?ids=ga:YOUR_GA_ID // Set your request metrics here &metrics=ga:visits,ga:pageviews // Set a filter for your page, you can combine multiple paths into one request using commas (OR operator) and multiple pagePath values &filters=ga:pagePath=~/event/x/,ga:pagePath=~/en/events/x/ // start-date cannot go before 2005-01-01 (GA launch date) and end-date should be set to today &start-date=2005-01-01&end-date=2014-04-15 This will return json data that you can then insert into a field. All in all, it seems easy: Setup a script that will parse all pages, get multiple values, create a GA Api query, get values, update database fields. Note that there are limits and quotas to the API. For what I need it, it's not a problem, but you might need to reach support to get more info. Hope this helps some of you.1 point
-
@Pete: we are on the same side (in german: "Du rennst bei mir offene Türen ein") +1 for implementing cc, bcc and attachment into the WireMail base class! Regarding attachments: https://processwire.com/talk/topic/5704-module-wiremailsmtp/#entry566311 point
-
I'm going to highlight this again horst as it's the important bit So whether yours or Teppo's module is installed or neither, emails can still be sent using the default Wiremail class. Therefore if I'm writing a module that requires email sending functionality, it needs to be able to use the same functions whether it's ryan's base module, the SwiftMailer class or your own module or module authors won't know what to expect. I think these WireMail modules need to be coordinated somewhat so that whatever the base class supports, the other classes also support so there are no surprises.1 point
-
Its not a bad start as a good overview, though look for other opinions too. He talks quite a lot about localisation and google places too, which seems to be very important if a company gets a lot of its work locally.1 point
-
I haven't had much (enough) time to work on my mailer module and haven't looked at how WireMailSMTP handles these particular things, but in general I'd have to agree with Pete. For things that are commonly used, it'd be best if there was a "standard" way to do that. One that doesn't depend on which module extending WireMail is installed at the time. I believe that we're talking about interfaces here, though that's not technically what it's going to be.. or what it is at the moment, at least. Then again, if @horst has implemented this feature already, I'll probably take a look at his implementation anyway and use similar public methods if possible to provide some consistency1 point
-
I love the ProcessWire road with the by-product of learning PHP. ProcessWire makes me eager to learn. And for the question: I don't like HTML in my template, I like php strings of HTML better. At the end it just makes it more readable. Mostly <?php is only used ones at the top of the file and thats it.1 point
-
I hear you - your sig is my thoughts exactly. But we're getting there and PW makes learning PHP so damn fun that we can just smile and enjoy the ride!1 point
-
Hi Jonathan, I added your little patch, and it helped preventing the recursion problems. The site content has been indexed.1 point
-
No, Yahoo and Bing stopped using them years ago. The description tag is the main meta used, with the title tag. The recommendation is that the description should be less than 160 characters and should read well. The title less than 60 characters. But the most important place for SEO is within the content of your page itself. I found this book a reasonable read: http://www.amazon.co.uk/How-Get-Top-Google-including-ebook/dp/B0076XVNM8/ref=sr_1_4?s=books&ie=UTF8&qid=1397561096&sr=1-4&keywords=search+engine+optimization Though you can get most of that info from just searching. Nice to have it in one place though. He avoids SEO tricks that might get undermined by the next Google update.1 point
-
Welcome to processwire. about polling: https://processwire.com/talk/topic/4042-poll-suggestions-for-voting/ modx => PW http://processwire.com/talk/topic/3691-tutorial-a-quick-guide-to-processwire-for-those-transitioning-from-modx/ http://processwire.com/talk/topic/3111-a-modx-refugee-questions-on-features-of-processwire/ http://processwire.com/talk/topic/2850-processwire-for-designers/page-2#entry30349 General Info https://processwire.com/talk/topic/4173-grouped-forum-posts-links-articles-tutorials-code-snippets/1 point
-
Hi ankh2054 and welcome to the forums! We also switched from MODX to PW little over year ago and haven't look back since. 1. Yes, dealing with users and permissions is really straight forward with PW - here's a good thread to begin with: https://processwire.com/talk/topic/107-custom-login/ 2. Simple as american pie: https://processwire.com/talk/topic/352-creating-pages-via-api/ 3. Everything's possible, here's some discussion: https://processwire.com/talk/topic/218-simple-poll/ There's lot of goof stuff in the forums and Google is your best friend!1 point
-
@Pete: you can ask Teppo directly. He (technically *) can implement it in SwiftMailer without any change in WIreMail base class. I have done it for bcc and cc. It is not more than to add these two as public functions to the SwiftMailer module and make them handle the according SwiftMailer calls for that headers. Simple! * don't know about his time budget nor if he ever want it1 point
-
Have send a pull request that solve it for cropped and uncropped variants: https://github.com/horst-n/ProcessWire/commit/2876bf6568e1bcc1efdee5e1f926f9f618493a52 But there is a need for more naming conventions: https://processwire.com/talk/topic/6028-regenerate-images/1 point
-
Hi, my image issue is solved. The issue was related to Image Interceptor module. I have not specified the values in portrait mode. Thanx for your help. Regards, Pravin1 point
-
Please have another read of the instructions: https://github.com/ryancramerdesign/FieldtypeMapMarker You need to either render the current page, or a page array, but in either case, you need to make sure you replace the second argument in the render to match the name of your map field. Have you checked the result of your $pages->find? In case you don't know about it already, take a look at Nik's excellent Selector Test module for testing the results of a selector.1 point
-
Caching images has not much to do with processwire in that way, images are cached by the clients web browser. And once it processed by processwire to make a thumbnail the direct URL to the image is used. Possibly when your images are generated with PHP you could set some headers to control caching. But this post on stackoverflow you might find interesting, it covers a way to embed images as base64 data in your HTML or CSS directly. http://stackoverflow.com/questions/1124149/is-embedding-background-image-data-into-css-as-base64-good-or-bad-practice1 point
-
Hey Nico, Sorry, I haven't done that yet - I actually thought you had some more stuff to do on your module around image importing and RTE embedding. I am super busy at the moment, but I'll see if I can get the hookable part sorted out for you in the next few days. Diogo's ideas actually got me a little sidetracked because I really want to add that functionality now too I'll PM you more thoughts to avoid spamming people here.1 point
-
Good idea! Would be nice to have this option in the installation process. Example option 1: install the PW default profile (simple site, recommended for learning) option 2: install PW blank profile (start from scratch, for experienced devs) option 3: install PW H5BP (start with a actual H5BP template, read more ...)1 point
-
For our client Continental - a german based (but international selling) tire manufacturer we were asked to develop a campaign featuring their sponsorhip for the "FIFA World Cup 2014". We came up with the idea to connect a positive and fun "soccer like offline experience" with Continental as a brand and social media elements plus user generated content as a multiplicator. To encourage people sharing their experiences with others there also are pretty nice prices to be won (tickets to the World Cup in Rio including flight and accommodation). In a glance we've developed everything related to this campaign: Idea, concept, logo, text, artwork, videos, content- and seeding strategy, a lot of print-materials, apps [...]. There even is a "real" stadium which can be either obtained at one of over 6000 partner stores in Germany or they may be downloaded and handcrafted by the players themselves. The campaign has ads in some of the biggest german print magazines (i.e. Stern Magazine). The Campaigns Microsite www.paper-shot.de features: it's own blog with some external authors a retailer locator for finding participating partners (yup, that's >6k partner-pages in pw ) each having a custom set of assets which are shown to people coming from their banners or entering their partner-code custom user registration video/image uploads with a preceding approval process (the videos are first processed by a seperate media-server to serve the right formats to all devices, then reviewed and published by a team of editors afterwards) user-voting twitter & facebook integration for voting and login (not live atm due to some server problems with oauth & our reverse proxy) an unified api that makes it possible to use all of the microsites features in our apps for iOS and Android (for those interested: they are built with PhoneGap/Cordova upon the great ionicframework using HTML5 & angularjs). This was by far the biggest PW-Project we've done yet and we (again) were always happy we've chosen processwire because we definitely needed something flexible for realizing all of this features in quite a small timeframe (about 2.5 months "production" time for the microsite + the apps). Modules used: FieldtypeCropImage - for obvious reasons FieldtypeMapMarker - for generating and fetching the lat/lng for all retailers and storing the adresses ImportPagesCSV - for importing the retailers as pages InputfieldCKEditor - because it's better (and better looking) than TinyMCE ModulesManager - PageEditPerRole - for managing external authors access ProcessBatcher - bulk actions for retailers (saved us HOURS of work!) SchedulePages - show/hide blogposts by date TemplateDataProviders - MVC structure for our templates TemplateNotes - help pages for external editors TemplateTwigReplace - MVC structure & "better" templating TextformatterHannaCode - custom tags for including external services like storify in blogposts TextformatterVideoEmbed - for blog articles VersionControlForTextFields - for "security" and backup reasons + some we've written for the project (they aren't very interesting ones to release to the public)1 point
-
1 point
-
It's definitely getting closer to being ready diogo. To be honest I hadn't really thought about automatically capturing changes - I kinda thought that was already in the works here: https://processwire.com/talk/topic/2117-continuous-integration-of-field-and-template-changes/ PTM is structured so that everything that is exported is based on the content of a parent page - all the child pages, templates, fields, page field content pages, etc. So it is designed to migrate new blocks of content. It can certainly update changes to these blocks to a live server too though. I guess it might be possible to make what you are saying work by using "Home" as the parent page of the export, so changes to the entire site are migrated. The automatic recording of changes so that the JSON file only contains changes is obviously the tricky part I'll read through mindplay.dk's experience in detail and see what suggestions I can garner. Off the top of my head I am thinking that maybe a simple approach might work - use the module's config data field to store and add to an array of pages, fields, and templates that change, captured whenever they are saved. That way I am not trying to record exactly what all the changes are, but rather just that something changed and therefore we should add that page/field/template to the list of things that needs to be exported. I'll think about it some more!1 point
-
Still nope. There was same question some time ago. Module config is stored as json and you use Inputfields not Fieldtype. There's the pager module I think where Ryan has text per language . Maybe worth a look. Sorry I think its in LanguageSupportPageNames module.1 point
-
Thanks, just pushed a fix for this. Good point! While I almost never use a "TO: name" (and many email clients, including gmail, don't even display it), it does make sense to support it. I've just updated it to support this. I went a little bit different route than you mentioned though, because there's always a chance two recipients might have the same name, but not likely they would have the same email. So I didn't think name would be workable as an array index. I also wanted to maintain consistency with how it's storing 'from' and 'fromName' separately, so the 'to' and 'toName' are stored in separate arrays. The 'toName' array is indexed by the email address. So now if you want to support use of 'toName' in your send() method, you'd do this: foreach($this->to as $email) { $name = $this->toName[$email]; if($name) { // send to: Name <$email> } else { // send to: $email } } If you don't need/want to support the "TO: name" (as in WireMailTest) then you don't have to do anything, as the means by which you access and iterate $this->to has not changed. As for how to supply to "TO: name" from the API side, you can do it any of these ways: // you can also use a string (or CSV string for multiple), like you would with PHP mail wireMail('User Name <user@example.com>', $from, $subject, $body); // array may be simplest if sending to multiple email addresses wireMail(array('user@example.com' => 'User Name'), $from, $subject, $body); // from the object side you can supply it as an optional 2nd argument to the to() method $mail = wireMail(); $mail->to('user@example.com', 'User Name'); // or in an array $mail->to(array('user@example.com' => 'User Name')); // or as a string (or CSV string for multiple) $mail->to('User Name <user@example.com>'); // the WireMail::from has also been updated to support a second argument or string $mail->from('sender@example.com', 'Sender Name'); $mail->from('Sender Name <sender@example.com>'); One other change is that the to() method no longer clears out any existing to() addresses on every call. So you don't have to supply all of your to: addresses in the single function call, you can call it multiple times, each with a separate email address if preferred. But if you do want to clear out the list, then just call the to() method with no arguments and it'll clear them. Yes, once we've merged the WireMail class into the master branch (stable), then I'll put out an updated FormBuilder that uses wireMail() rather than mail(). Though if anyone needs it sooner, I'll be happy to post an updated FormBuilderEmail class that uses wireMail().1 point
-
Sorry, am rushing somewhere...the following will answer your question http://processwire.com/talk/topic/2786-request-seems-to-be-forged/ http://processwire.com/talk/topic/1563-this-request-was-aborted-because-it-appears-to-be-forged/ http://processwire.com/talk/topic/2102-using-previous-pw-installation-as-template-for-the-next-one/ http://processwire.com/talk/topic/2763-500-error-when-visiting-the-backend/ http://processwire.com/talk/topic/3668-internal-server-error-in-admin-page/1 point
-
The "link to larger version" is actually intended to be without implementation so that you can implement it with a lightbox of your choice. Rarely in my sites do I actually leave it as literally linking to the larger version. Instead, I'll usually put in some javascript like this: $(document).ready(function() { $("#bodycopy a:has(img)").fancybox(); }); Or if you want to add some attributes and do it that way: $(document).ready(function() { $("#bodycopy a:has(img)").addClass('lightbox').attr('rel', 'gallery'); $("a.lightbox").fancybox(); }); Now if you want to be able to support more then one way of linking to a large image (i.e. have one link to the larger version and another opening in a lightbox) then you'd probably need to take another approach (or maybe make a module). Let me know if that is your need.1 point