Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 01/29/2020 in all areas

  1. The easiest way to change the logo is by going to (once logged in) Modules -> Core -> AdminThemeUiKit . You will see a section labeled Masthead + navigation. You should then be able to upload a new logo for the backend through the field provided. As far as changing colors of the header, the easiest approach might be to follow what Jonathan Lahijani said here:
    2 points
  2. On the other hand, "flat", that is non-normalized tables, scale only somewhat. Where they don't scale well is in update performance, so if a site is highly dynamic, updates create massive locks and those locks impact the frontend too. Then, if a CMS uses non-normalized tables, multi-valued and complex field contents will have to be serialized and de-serialized to fit into their column. That's only fine until you want to search for it. In that case, things get ugly, and if that search can even be implemented, it will be a much worse performance hog than ten extra field tables in PW. The web server question "does it scale?" is usually not answered by database statistics. It's answered by a concise design that allows for good, hierarchical and atomic caching strategies. If a site is designed with that in mind (and even sometimes when it isn't), performance can easily be improved. I like to take our corporate intranet as an example, with 12000 active pages, now 125 templates, 28 repeaters, 35 site modules, 220 additional php scripts and everything a good book on website speed basics tells you not to do ? We have around 1000 users who use it daily, and a good number of them have a few auto refresh pages loading every 2 minutes. I'm running opcache, use processwire's $cache interface to populate recurring, user dependent patterns in some fields and have a small home-written module that uses memcache to store and refresh data that would otherwise be retrieved from external systems with each call. First time page load including fonts, styles and a healthy collection of scripts is about 5 seconds. Times to page view for consecutive visits to the site are almost always below 2.5 seconds. Everything runs on one single server, including the database, and there's no caching proxy in front of it. That's on PW 3.0.125. I'm currently in the process of upgrading to latest IIS, latest PW stable and latest PHP. My first impression is that I'll probably get the time-to-view reliably below 2 seconds with a bit of tuning.
    2 points
  3. This is an update about how it's been running blog sites using ProcessWire. I hope it's OK for me to post in this category even though I've already showcased my sites awhile back. I thought it would be helpful for people to get a feel for what it's like to use ProcessWire on an ongoing basis for blogging. Often people talk about the development of a site, but it's not quite as often that we hear about the ongoing running of a PW site and how the PW API influences that, which is what I'll cover here. As background, we at The GrayFly Group own and run the blogs goodkidsclothes.com and flipfall.com. The development of these PW sites has been covered in a showcase thread for GoodKidsClothes and another for FlipFall. Here are some of the unique experiences I've had running these two sites. "Running" covers everything from coding and making modifications to the templates, to writing our articles, to interacting with ad partners or with others seeking us out for something related to one of those sites. So this is a different experience from agencies who develop for others; we develop for ourselves. As background, the main traffic to the websites comes from organic search results. Income from sites is from affiliate marketing and advertisements. GoodKidsClothes PW experience: "to think it is to do it." For GoodKidsClothes.com, one of the things we noticed was that if we could think it, we could do it, thanks to the easy-to-use PW API. The need for a change Here is a concrete example of what I mean: we noticed that many people would enter the site on an older article (e.g. via a search result). However, we continually put out a lot of time-sensitive information, e.g. a style guide, a piece of news relating to a change in a children's clothing company, etc. I didn't want people to miss out on this, yet many were, because after reading their entry page, they'd leave. They had no idea (unless they clicked on the link to home page) that there was another article that could be of value to them. All too often, by the time people learned about that new article via search results, they'd be too late for the news to be relevant - in fact, it wouldn't even be the newest article anymore by that point. The solution So, using the PW API, we modified the article template so that if someone was reading any article that was not the most recent article, then at the end of what they're reading, they'd see a small section highlighting the most recent article. Here is a screenshot: As you can see above, our newest article is highlighted immediately below the article they're reading, unless of course they are already reading the newest article. In the case shown above, the newest article (recipe-related) did not happen to be time-sensitive, but in most cases that article would be time-sensitive, so that's why we made this change. To make the change we simply used the PW API to query what the latest article was and store its identity in a variable - those sorts of queries we set up in _init.php. Then we modified the article template such that if the current page was not the latest article, to include the featured box that you see above. Another need for a change You'll also notice links in boxes above and below where the featured article box is. These are ads (they blend OK right?!) These ads brought another problem to our attention: we'd put the ads blocks on all articles equally. However, in the case of the most recent article, often the most recent article would usually have a time-sensitive offer or some other call to action e.g. signing up for our newsletter (well, not in the case of the recipe article above, but in most cases the latest article would have something we prefer the reader to do). We didn't then want our readers to get distracted by the ads and either leave the site, or click on an ad and click away from the site, instead of doing whatever the call to action is. The solution Again using the ProcessWire API, we modified the "article" template so that there was conditional logic on the ads: if the current page is not the latest article, include the ad code (otherwise no ads). This mean no ads were seen on the most recent article, allowing for less distractions to the reader on time-sensitive articles and more likelihood of them following through on the call to action. Conclusion for GoodKidsClothes We were able to make all these changes within minutes of thinking of them! In-house, without a ton of knowledge of programming, thanks to the awesome ProcessWire API. We actually made all those changes live, i.e. going in there and making changes to the code of the site as its running live. Yes, we had backups of the entire site and we always first save a copy of the template file under a different name (usually prefixing it with OLD_ ) before modifying the live version. This is how helpful ProcessWire is. We can make changes that benefit our site and make them in-house as we think of them. If this was done under some other CMS, we would be unable to make those changes without either a) hiring a developer or b) training up in whatever the other CMS is to make the changes in-house. Either way, it would take considerably more time to do anything. So, despite not having a formal programming background, we now have a very "nimble" site that we can adapt as needed to changes that we desire, within minutes of thinking of the change we need, with only needing to know a little PHP, html, and CSS, just the very basics, and looking up the PW API. FlipFall PW experience: "the answer is yes." In the case of FlipFall, there have been times when a potential ad partner asks a question like "can you put different ads on different categories?" or other things. Sometimes they are questions I ask myself of the website "Can we do A/B testing of different ads; i.e. show a certain ad block 50% of the time totally randomly and another ad block the other 50% of the time?" "How about ads from this company some of the time and a different company other times?" The answer is always "yes." Coming from other CMS's (that I used but did not program with) I used to brace myself a bit if I saw an email that asked "Can you....?" but now thanks to ProcessWire I don't have that bracing reaction any more. So long as I can think of a way to do it (and so far I always have, thanks to the PW API), I can say "Yes we can." More to the point, I can actually say "Yes, we can make those changes in-house within [whatever brief timeframe I think it will be]" instead of having to be vague about timeframes because of needing a developer. So I no longer worry about "Can you ...?" questions because the answer is yes. Overall conclusions ProcessWire is a superb CMS for those who own and run a site. The PW API makes it easy to make changes to the look and functionality of the site as needed. Such modifications wouldn't easily be possible on alternative CMS's that are heavily "theme-based".
    1 point
  4. New showcase entry, for Aaron Copland, composer. https://www.aaroncopland.com/ Features Filterable/Searchable Works Listing with category, publisher, instrument, tag, keyword, or year range filtering Each work has a page showing meta data, as well as related media like audio, images, video, and related events & news. Works are cross related at various levels, as Copland would sometimes use sections of one work in other works Microdata (json-ld) for site, person, works, images, news and some events Ability to display embedded media like Spotify, Youtube/Vimeo, Getty Images, Archive.org etc. Fast autocomplete site & works search Modules used Admin Custom Files AOS Page Field Edit Links Auto Smush Batch Child Editor Custom Inputfield Dependencies Admin Comments* Secure Files Font Awesome Pro Import External Images Autocomplete for CK Editor Inputfield Selectize Simple MDE Visual Page Selector Font Icon Picker Page Field Info Page Table Extra Actions Pages 2 PDF Changelog Dashboards Process Documentation Settings Factory Restrict Tab View Selectize Template & Field Tags Prev/Next Tabs Text Input Awesomplete Get Video Thumbnails Ion Rangeslider Runtime Markup Config Form Inputfield Color Inputfield Field Descriptions Extended Cookie Management Banner ProCache Lister Pro Profields (Table mostly) FormBuilder Various custom modules *Admin Comments is a module in development that enables site admins/editors/managers to add comments to pages in the backend and to optionally notify other site admins/editors/managers. Possibly to be released in directory soon.
    1 point
  5. I have found that depending on the theme and device, #pw-masthead might to cover everything. #masthead, #branding, #pw-masthead, #pw-masthead-mobile, body.AdminThemeReno a.main-nav-toggle { background-color: #666 !important; }
    1 point
  6. Hmm. This is a tricky one as it is made up of two parts: Paying a fraction (instalment) of the total cost Future payment (aka recurring payment) Both are tricky, but especially #2. #1 is partly achievable by raising an invoice using manual order creation. The order will be manually marked as complete once the total has been paid. Automating the process may not be an easy task. I'd have to think about it more. # 2 If this means storing user card details, then no; we are not going down that route. However, if it means using payment providers' subscription/recurring payments services, then it is probably doable. The payment providers API is there. Something else to think about, but for future versions. Currently none of these features are in the plan, but I'll have a think. I will probably need reminding though :-).
    1 point
  7. Hi PSY! Thanks for this. Really helpful! I ended up getting it working once I found the missing PWlink plugin and have disabled some formatting tools too!!!
    1 point
  8. @prestoav I needed something similar however I did not want to give the front end users all the features available in the PW CKEditor menu. It was more difficult for me to reduce the feature set than start afresh for the front end and I chose TinyMCE over CKEditor. In the form, I created a textarea field with no textformatters and a limit of 5000 characters. In my template: <script src="<?=$config->urls->templates?>scripts/tinymce/tinymce.min.js"></script> <script> // NoMinify tinymce.init({ selector: '#Inputfield_introduction', height: 300, menubar: false, plugins: [ 'advlist autolink lists link image charmap print preview anchor', 'searchreplace visualblocks code fullscreen', 'insertdatetime media table paste code help wordcount' ], toolbar: 'undo redo | formatselect | bold italic backcolor | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | removeformat | help', setup: function(ed) { var maxlength = parseInt($("#" + (ed.id)).attr("maxlength")); var count = 0; ed.on("keydown", function (e) { count++; if (count > maxlength) { alert("You have reached the character limit"); e.stopPropagation(); return false; } }) } }); </script> And the end result on the front end: Data is saved correctly in the DB and all good. PS: If anyone tries to add in a sneaky <script>, it throws 403 Forbidden error
    1 point
  9. Just refactored the code a little to remove the redundancy (moved getViewFile to a separate function). I noticed for some reason the line endings were all CRLF on the module file (but seem to be LF for all other files, excepting the .md ones) so I ran it through dos2unix to clean that up. Kept the two things as different commits for clarity of course. Changes are again in my https://github.com/porl/TemplateLatteReplace fork. I've been testing this since the dirty hack attempt early yesterday and so far haven't come across any troubles.
    1 point
  10. One field for each role could cause problems, because a new user might have more than one role. Then: which message do you send? All of them? You would need some complicated conditional logic in the UI. Not all that easy.
    1 point
  11. UPDATE 2020-01-28 I just added the Snipcart "Custom Order Fields" feature! Thank's @Noboru & @d'Hinnisdaël & @szabesz for your help and hints! Custom order fields can be added/configured by editing a hidden config page under Admin > Setup > SnipWire > Custom Cart Fields. The corresponding template/page/field resources are preinstalled by SnipWire installer. If you update to the new module versions, those resources will be added too! The config page has a single textarea field where you can add the configuration strings for your custom cart fields: (multi language support is also available) ... can also be edited and enabled/disabled from within SnipWire module config. The config from the screenshot above leads to the custom step "Order Info" in checkout process: The Snipcart docs for Custom Order Fields (v 2.0) can be read here: https://docs.snipcart.com/v2/configuration/custom-fields Next step is to implement custom product fields! When this is done, I'll release the first official version. SnipWire will then be added to the ProcessWire module directory (as far as @ryan accepts it).
    1 point
  12. Thank you! That worked perfectly. I new I was missing something! Just for completeness here's my resulting code for now: // Prepare and output body text (cleans <p> tags with &nbsp; inside) $bodyCopy = preg_replace('/<p>\x{00A0}<\/p>/u', '', $page->body); echo $bodyCopy;
    1 point
  13. Ok, in that case you can still filter out the unnecessary paragraph with the non-breaking space inside. Your str_replace function probably doesn't work because you are trying to replace the literal string &nbsp;. That won't work because the non-breaking space is (most likely) stored inside the database as a Unicode character, not as the HTML entity. Matching "<p> </p>" won't work either, because that is a regular space, not a non-breaking space. To replace the non-breaking space, you can use a regular expression and match the specific NO-BREAK SPACE Unicode character. This works for me: $string = "<p>&nbsp;</p>"; $string_unicode = html_entity_decode($string); // $string_unicode now contains a non-breaking space unicode character echo preg_replace('/<p>\x{00A0}<\/p>/u', 'Successfully replaced!', $string_unicode); // Successfully replaced! Make sure to include the u flag to treat the string as UTF-8. You could also modify this to match multiple non-breaking spaces or whatever CK Editor throws at you ? You can use that either to remove the superfluous paragraph in your template output, or write a little script to convert the text saved in the database (which is the cleaner way to go, if you ask me).
    1 point
  14. I think it's an oversight that should be fixed - I think you should post a Github issue for Ryan to think about. He may not agree but I think that is the best way forward.
    1 point
  15. Ryan was kind enough to agree to answer some questions about himself and about ProcessWire for an interview which I've posted over on my blog at http://codingpad.maryspad.com/2013/07/19/interview-with-ryan-cramer-processwire-cms-founder-and-lead-developer/ I think it's a pretty good read and quite informative and hope it brings lots more exposure to PW and how awesome it is! Many thanks Ryan, you rock!!
    1 point
×
×
  • Create New...