Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 07/26/2016 in all areas

  1. This is my most ambitious PW site yet: http://vroom.pt It's an auto ad portal specially designed towards professional dealers. Some highlights you can't really see just browsing the website: Custom CMS for dealers (screenshot); Auto generated, customizable website for each dealer (examples here and here); The dealer can choose between a dark or light theme, then set a tone color; More themes will be added in the future with completely different designs. Optimized search algorithm to keep speed reasonable even when searching through thousands of results.
    9 points
  2. Hello, I made this clone of the Ghost Blog System (http://ghost.org) for demo of the Wire Render Pattern as well as a multi language site and menu system. https://github.com/NinjasCL/pw-ghost As always MIT licence.
    7 points
  3. Hey guys, Just yesterday I launched my new website, SuperTINY agency : http://supertiny.agency. It's a small but pretty heavy website with all the webgl going on. Older machines will choke. I'm using PW v3 on this one. Took only a couple of hours to install, setup the fields and templates necessary to run the portfolio, add AIOM and SEO and get it running. Got to love PW for that. The case studies are built using a repeater with fields that show/hide according to what's selected on a "type" selector. Clean, simple, just the way I like it. Enjoy.
    6 points
  4. This module allows the default admin - and other users you specify - to login as any other user as defined in the module config. This could be useful for reproducing errors your users can see on websites or during testing, but I would suggest it is used wisely as there are some obvious snooping abilities in using this. Once installed, you can configure the module to be usable by various members of staff other than the default admin account, as well as define which roles or individual users you will be able to login as. After saving the config settings, you will find a page under the Setup menu in the admin called "Switch User". Selecting a user from the list checks via AJAX whether the user has admin access (this is a basic check for the page-edit permission as by default the admin homepage requires page-edit to load the page tree) and will either allow you to redirect to the homepage or back to the admin depending on that check. Download Here Version History 0.0.6 - Initial release
    5 points
  5. Yep, me too. I'm guessing that maybe half a dozen people know PW well enough to be familiar with all the clever stuff available. And that is in no way a criticism - it's just that there are so many cool features (and more added almost weekly) that us mere mortals (me anyway) struggle to keep up. But it's an absolute joy to see threads like this.
    4 points
  6. Actually crashed my on-board graphics. And I'm not even joking.
    3 points
  7. Guys, It was a premissions problem. I ended uploading everything using ftp, and now is working fine. For some reason, when I packed the site using the Mac compress utility the permissions are screwed. Anyway, Thank you Guys for the help.
    3 points
  8. Your templates folder has 777 permissions - some hosts don't like this and will throw errors. And the permissions look a bit funny in general. For my sites all folders have 755 and all files have 644 (apart from config.php which is set to 400 for security reasons).
    3 points
  9. @Surikat - perhaps you are just trying to enlighten us all about RedCat and we appreciate that, but it does smell a little like advertising. You should know that ProcessWire is actually a framework first and the optional CMS component is actually built on top of this framework. I know this is not obvious from reading some of the blurbs on the website, but this is one of the main reasons why ProcessWire is so great because you have all the tools from the framework available for your use on the frontend, or to build your own CMS on top of it if you wish.
    2 points
  10. Can't you add it to the Character Replacements list in the Page Name config settings: /module/edit?name=InputfieldPageName
    2 points
  11. You'd create each field separately, so you can "rollback" each field separately, too. Migrations are not bound to "a specific development step" or alike. Just add as many as you need to bring the installation to the state you need. Rollback's are also the way to go if you made some mistakes. Just rollback the migration, change your mistake and rerun it. If you've already shared the migration, or you've already saved data you want to keep, you could also add another migration, which does only correct your mistake, e.g. for your example just set the field limit and save this change.
    2 points
  12. Nice one @heldercervantes. Looks like a good candidate for a case study write-up
    2 points
  13. No need for the if statement here: $hero_images = $page->closest("hero_gallery.count>0")->hero_gallery; (Also the count selector is incorrect above)
    2 points
  14. And if you want a bit more nicer syntax consider this one: https://github.com/tightenco/collect https://laravel.com/docs/master/collections
    2 points
  15. Welcome to the community! Have a read of this thread. So you should try something like this: if (count($page->hero_gallery)>0) { $hero_images = $page->hero_gallery; } else { $hero_images = $page->parentsUntil("count(hero_gallery)>0")->hero_gallery; } (Just written in the browser, didn't try it myself.)
    2 points
  16. The best possible way is probably using migrations throughout the whole development phase, but you can also add them in at a later stage as well. All you need is a common db (code) state to start from for (all) systems. Personally I'd stay away from doing any template/field changes via the UI for as much as possible. This keeps you from "just changing this one thing real quick" and forgetting about it. But sometimes if you're experimenting because you're not 100% sure how to tackle a problem it might be faster to go that way. One just needs to be aware that everything needs to be a migration in the end. The second key is treating migrations like git branches/commits – Modify anything at will for as long as you haven't shared it to collaborators – Do not touch anything otherwise and rather add another migration to fix any errors/changes. One benefit of having this level of detail in migrations (which might be daunting) is that you can really quickly apply/undo changes you've added to the system. To get started with template/field changes you'd probably go like this (first two examples come with the module): Create fields initially (example) Create template initially (example) Make modifications with default migrations (example) Repeat 1–3 as needed (Maybe delete something every now and then) For snippets I've created the GitHub repo linked in above posts. I'll certainly add things there as well, but it's really meant to be a community effort to make this great. E.g. I'm currently not using multi-language anywhere, but others do so and might use interesting snippets. I'm also very much interested in other opinions regarding the whole workflow. By now I'm using it just for myself, where it's working great (sadly I cannot share to much of it), but others might have different opinions and workflows.
    2 points
  17. here you have a working example respecting 0 values: https://eval.in/612114 taken from http://stackoverflow.com/questions/35527457/array-filter-skip-null-or-0-value
    2 points
  18. Hi @Bryson. Welcome to ProcessWire and the forums. Thanks for using Blog. At the moment, the Blog module is not compatible with version 3 of ProcessWire. Once we have a stable release of PW 3, I'll work on making them play nice together. The missing dependency is Fancybox which has been dropped in PW 3/2.8 in favour of Magnific. As for the double/two pages in one, I think you are seeing that because you tried to use one of the site profiles that ship with PW (e.g. default or beginner profiles) together with the demo template files that ship with the Blog module. They will clash. If you want to use one of those profiles, I suggest you copy and paste code from Blog demo template files into the profile's template files. It might be easier though, when installing ProcessWire, to instead use the blank profile. I recommend this to whoever wants to learn from scratch since you are starting off a clean slate. However... Let's start with the basics first. ProcessWire allows you to build your websites exactly how you want them. This means no one template file approach is forced on you. There are different ways to structure your template files as explained in these tutorials. The template files that come with the Blog module and the code in them are just examples to get you started. They use the so-called delayed output. Of course you can choose to use the examples or even start from scratch. What you see in /Blog/template-files/ are its demo template files I refer to above. On install, if you selected to install Blog with the demo content, they are copied over to /site/templates/ Default Name: For security reasons, Blog does not output your name (which is actually your ProcessWire log in name) as the author of Posts. Instead, you need to edit the user and use the Title field to input your author names...e.g. 'Prince Charles'. Sorry, my answer seems to be a bit jumbled up. Here's what I'd advice you though: I suggest you get to know how ProcessWire works first by reading the basic docs, especially how to use the API. Using the Blog module to learn about ProcessWire may be a bit advanced for people new to the system. Secondly, have a read about the various templating strategies. You will then be able to tell where $content comes from :-). Finally, if you have some knowledge of PHP, I suggest you install ProcessWire with the blank profile. It will help you learn better IMHO...I know this is not for everyone, but I like starting from a clean slate. You can then use whatever templating strategy you wish. Let us know if you need further help...
    2 points
  19. Learned something new here, too. Thanks to all.
    2 points
  20. You currently have this: Note that there is no "/" before "site", which means it will try to load: http://diofralealtrecoseparla.newageofcattolicesimo.it/site/templates/js/site/templates/css/style-wide.css instead of: http://diofralealtrecoseparla.newageofcattolicesimo.it/site/templates/css/style-wide.css PS Have a read here about urls: http://ifyoucodeittheywill.com/2009/03/absolute-relative-and-root-relative-urls/
    2 points
  21. New fun little site: http://wineatsandsweets.com. Responsive. Even though this is a little site on the front-end, in the admin, we have done a lot of work to handle and process entries. ProcessWire made making the custom functionality and organizing the admin for a great user experience a breeze. Every time I make a site and do a bit of work in the admin, I am amazed that I am able to produce results that look, feel, and act as if the whole CMS was custom rolled for my clients. PW FTW! Using a few modules, Field type Star Rating Process Page Field Select Lister Pro Pro Fields Field type Range Slider I wanted to add that every-single piece of content on this site was added and produced by my client. That always amazes me. Processwire is so easy to use for my clients that I just give them the keys and they go to town working on their website(s).
    2 points
  22. Child pages can have multiple parents of the same template, so they are listed there to chose a parent for you're child page. Just my guess. If i click on terms i get on a new page to chose a parent Clicking on a parent skips that page.
    2 points
  23. Since you guys asked for it, I'll take a stab at a case study on the development process. Most of the development was done in about a week and a half. I started with the basic profile, but it ended up being something somewhat similar to the Blog profile in terms of how it's structured. Below I'll cover some details on the biggest parts of the project, which included data conversion, the template structure, the front-end development and anything else I can think of. Data Conversion from WordPress to ProcessWire One of the larger parts of the project was converting all of the data over from WordPress to ProcessWire. I wrote a conversion script so that we could re-import as many times as needed since new stories get added to cmscritic.com almost daily. In order to get the data out of WordPress, I queried the WordPress database directly (my local copy of it anyway) to extract what we needed from the tables wp_posts for the blog posts and pages, and then wp_terms, wp_term_relationships, and wp_term_taxonomy for the topics and tags. WordPress stores its TinyMCE text in a state that is something in between text and HTML, with the most obvious thing being that there are no <p> tags present in the wp_posts database. Rather than trying to figure out the full methodology behind that, I just included WP's wp-formatting.php file and ran the wpautop() function on the body text before inserting into ProcessWire. I know a lot of people have bad things to say about WordPress's architecture, but I must admit that the fact that I can just include a single file from WordPress's core without worrying about any other dependencies was a nice situation, at least in this case. In order to keep track of the WordPress pages imported into ProcessWire through repeat imports, I kept a "wpid" field in ProcessWire. That just held the WordPress post ID from the wp_posts table. That way, when importing, I could very easily tell if we needed to create a new page or modify an existing one. Another factor that had to be considered during import was that the site used a lot of "Hana code", which looked like [hana-code-insert name="something" /]. I solved this by making our own version of the Hanna code module, which was posted earlier this week. Here's an abbreviated look at how to import posts from WordPress to ProcessWire: $wpdb = new PDO("mysql:dbname=wp_cmscritic;host=localhost", "root", "root", array(PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES 'UTF8'")); $posts = wire('pages')->get('/posts/'); $sql = " SELECT * FROM wp_posts WHERE post_type='post' AND post_status='publish' ORDER BY post_date "; $query = $wpdb->prepare($sql); $query->execute(); while($row = $query->fetch(PDO::FETCH_ASSOC)) { $post = $posts->child("wpid=$row[ID]"); // do we already have this post? if(!$post->id) { // create a new post $post = new Page(); $post->template = 'post'; $post->parent = $posts; echo "Creating new post...\n"; } $post->of(false); $post->name = wire('sanitizer')->pageName($row['post_name']); $post->title = $row['post_title']; $post->date = $row['post_date']; $post->summary = $row['post_excerpt']; $post->wpid = $row['ID']; // assign the bodycopy after adding <p> tags // the wpautop() function is from WordPress /wp-includes/wp-formatting.php $post->body = wpautop($row['post_content']); $post->save(); echo "Saved post: $post->path\n"; } What I've left out here is the importing of images, topics, tags, and setting the correct authors for each post. If anyone is interested, I'll be happy to go more in depth on that, but didn't want to overwhelm this message with code. Template File Structure This site makes use of the $config->prependTemplateFile to automatically include the file _init.php before rendering a template file, and $config->appendTemplateFile to automatically include the file _main.php after. So the /site/config.php has this: $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; You may recognize this as being the same setup from the Skyscrapers profile. The _init.php includes files containing functions we want to be available to all of our templates, and set default values for the regions we populate: /site/templates/_init.php /** * Include function and hook definition files * */ require_once("./includes/render.php"); require_once("./includes/hooks.php"); /** * Initialize variables populated by templates that get output in _main.php * */ $browserTitle = $page->get('browser_title|title'); $body = "<h1>" . $page->get('headline|title') . "</h1>" . $page->body; $side = ''; $renderMain = true; // whether to include the _main.php file The includes/render.php file that is included above includes several functions for generating markup of navigation and post summaries, or any other shared markup generation functions. Examples are renderPost(), renderNav(), renderTags(). This is similar to the blog.inc file from the Blog profile except that I'm letting these functions generate and return their own markup rather than splitting them into separate view files. I personally find this easier to maintain even if it's not as MVC. The includes/hooks.php sets up any hooks I want to be present for all of my templates. I could have also done this with an autoload module, but found this to just be a little simpler since my hooks were only needed on the front-end. The main hook of interest is one that makes all posts look like they live off the root "/" level rather than "/posts/" (where they actually live). This was in order to keep consistency with the URLs as they were in WordPress, so that the new site would have all the same URL as the old site, without the need for 301 redirects. /site/templates/includes/hooks.php /** * This hook modifies the default behavior of the Page::path function (and thereby Page::url) * * The primary purpose is to redefine blog posts to be accessed at a URL off the root level * rather than under /posts/ (where they actually live). * */ wire()->addHookBefore('Page::path', function($event) { $page = $event->object; if($page->template == 'post') { // ensure that pages with template 'post' live off the root rather than '/posts/' $event->replace = true; $event->return = "/$page->name/"; } }); Our /site/templates/_main.php contains the entire markup for the overall template used site wide, from <html> to </html>. It outputs those variables we defined in _init.php in the right places. For example, $body gets output in the <div id='bodycopy'>, $side gets output in the right <aside>, and $browserTitle gets output in the <title> tag. /site/templates/_main.php <?php if($renderMain): ?> <html> <head> <title><?=$browserTitle?></title> </head> <body> <div id='masthead'> // ... </div> <div id='content'> <div id='bodycopy'><?=$body?></div> <aside id='sidebar'><?=$side?></aside> </div> <footer> // ... </footer> </body> </html> <?php endif; ?> We use the rest of the site's template files to simply populate those $body, $side and $browserTitle variables with the contents of the page. As an example, this is an abbreviated version of the /site/templates/post.php template: /site/templates/post.php // functions from /site/templates/includes/render.php $meta = renderMeta($page); $tags = renderTags($page); $authorBox = renderAuthor($page->createdUser); $comments = renderComments($page); $body = " <article class='post post-full'> <header> <h1>$page->title</h1> $meta </header> $page->body $tags $authorBox $comments </article> "; if(count($page->related)) { $side = "<h4>Related Stories</h4>" . renderNav($page->related); } What might also be of interest is the homepage template, as it handles the other part of routing of post URLs since they are living off the root rather than in /posts/. That means the homepage is what is triggering the render of each post: /site/templates/home.php if(strlen($input->urlSegment2)) { // we only accept 1 URL segment here, so 404 if there are any more throw new Wire404Exception(); } else if(strlen($input->urlSegment1)) { // render the blog post named in urlSegment1 $name = $sanitizer->pageName($input->urlSegment1); $post = $pages->get("/posts/")->child("name=$name"); if($post->id) echo $post->render(); else throw new Wire404Exception(); // tell _main.php not to include itself after this $renderMain = false; } else { // regular homepage output $limit = 7; // number of posts to render per page $posts = $pages->find("parent=/posts/, limit=$limit, sort=-date"); $body = renderPosts($posts); } The rest of the site's template files were handled in the same way. Though most were a little simpler than this. Several were simply blank, since the default values populated in _init.php were all that some needed. Front-end development using Foundation 4 The front-end was developed with the Foundation 4 CSS framework. I started with the Foundation blog template and then tweaked the markup and css till I had something that I thought was workable. Then Mike and I sent the _main.php template file back and forth a few times, tweaking and changing it further. There was no formal design process here. It was kind of a photoshop tennis (but in markup and CSS) where we collaborated on it equally, but all under Mike's direction. After a day or two of collaboration, I think we both felt like we had something that was very good for the reader, even if it didn't originate from a design in Photoshop or some other tool like that. I think it helps a lot that Foundation provides a great starting point and lends itself well to fine tuning it the way you want it. I also felt that the mobile-first methodology worked particularly well here. Comments System using Disqus We converted the comments system over to Disqus while the site was still running WordPress. This was done for a few reasons: Disqus comments provide one of the best experiences for the user, in my opinion. They also are platform agnostic, in that we could convert the whole site from WP to PW and not have to change a thing about the comments… no data conversion or importing necessary. Lastly, ProcessWire's built-in comments system is not quite as powerful as WordPress's yet, so I wanted cmscritic.com to get an upgrade in that area rather than anything else, and Disqus is definitely an upgrade from WP's comments. In order to ensure that Disqus could recognize the relations of comment threads to posts, we again made use of that $page->wpid variable that keeps the original WordPress ID, and also relates to the ID used by the Disqus comments. This is only for posts that originated in WordPress, as new posts use a ProcessWire-specific ID.
    1 point
  24. Hi guys so currently am writing a detailed tutorial about creating Modules, I have never created a module because i don't know all the classes and interfaces required, so this is like a detailed research for me, this is how i learn things by writing articles. However I might make some mistakes so i decided to make it on Google Docs to get comments and feedback, before posting on my website and Processwire tutorial site, this is going to be one heck of a detailed tutorial. Here is the link I will be updating it https://docs.google.com/document/d/1VA_WK-5qbnq3Ux_EOW3p92IcjbAcVZJ0aewIiFxmv2Q/edit# However I wanted to get a clear picture of the following Process Class and ConfigurableModule i noticed some modules require it and some don't My interpretation is that Modules with admin setting pages uses ConfigurableModule and Process are modules who require access to $this->pages and that sort Thanks all
    1 point
  25. I've updated the module with some small changes. Exceptions are no longer unintentionally catched when using the CLI tool. Also the default migration format does now include seconds in the timestamp. These are optional so migrations without seconds will still work.
    1 point
  26. Thought it was high time I released this one into the wild after sitting on it for a year or more - oops!
    1 point
  27. @Bryson Brilliant. Glad you got it sorted. Forgot to mention, in case you missed it, the (almost) complete documentation for Blog is here.
    1 point
  28. It replaces some typographic marks with better ones depending on context.
    1 point
  29. Have you tried this app? https://glyphsapp.com/tutorials/creating-an-icon-webfont
    1 point
  30. I don't really understand what your page structure is and what you are trying to output. Maybe you could show... the structure of this branch of the page tree what templates are used at each level an example of what you want your output to be ...then it would be easier to help. But generally I think the problem is that you need to get $categ_team_year and $past inside your loop, using $categ. Also, you need to use count() in your if() statements when testing if a PageArray is empty. Maybe something like: $categ_team = $page->children("template=categ_team"); foreach($categ_team as $categ) { $categ_team_year = $categ->children("template=categ_team"); $past = $categ->find("template=member, actual=0"); $content .= "<h2><a href='{$categ->url}'>{$categ->title}</a></h2>"; if(count($categ_team_year)) { foreach($categ_team_year as $year) { // do something with $year } } if(count($past)) { foreach($past as $member) { // do something with $member } } }
    1 point
  31. Just added color significance to PW and Tracy Log panel icons. Red for errors, exception, critical Orange for everything else, including warnings, info, debug, and any custom names PW logs Green for none All colors are based on log entries from the last 5 seconds which should cover everything loaded/redirected etc during the last page load. The idea being that you don't want the red or orange colors to be triggered from an error that was recorded days ago, even if it's the most recent entry. Hopefully this logic makes sense and it provides a useful visual cue to let you know that something was just logged. PS - as part of this I needed a different icon for the Tracy log panel - you'll see it's now burning campfire logs - it's actually hard to find a nice small icon for logs
    1 point
  32. You could follow the example of the core Datetime fieldtype module and convert back and forth from SQL datetime to Unix timestamp on sleep/wakeup.
    1 point
  33. Thanks again for all that. The one that stands out is the ToDo panel - I honestly haven't tested that on a large site with many template php/css/js files, so perhaps that is expected. Maybe I need to implement some caching so that it only scans files if they have been changed since the last scan. That should help with that significantly. Actually, you should take a look at the ToDo panel config settings and exclude any js/css from external libraries - I bet that is what is slowing that down. My ToDo panel renders in 0.03s compared to your 1.27s! I was actually thinking about adding caching to the Validator panel as well although that one will be a little more complex as it will require storing the rendered HTML so it can be compared. Regarding the generally slow nature of your local dev setup - have you read this thread: I feel like it might be the reason Tracy is running so slow - would be worth a look regardless as it seems like you are experiencing slow page loads even without Tracy, although of course I don't know what resources your page is loading.
    1 point
  34. Hum... you can remove the style and scripts folders inside templates/ as you are not using them. But if you have the css and js file inside 'assets', maybe the error is from using PHP shortcode syntax to echo the path on: <?= $config->urls->templates; ?>assets/ Try using: <?php echo $config->urls->templates; ?>assets/
    1 point
  35. One question, did you move the .htaccess to the devel folder? I just tested a PW local installation here, running on MAMP: 1 - It was running under pw-multilang.dev with default config.: My config.php has $config->httpHosts = array('pw-multilang.dev', 'www.pw-multilang.dev'); 2 - I created a 'devel' folder inside the folder and moved all files, including the .htaccess, to it. Checked http://pw-multilang.dev/devel/ and all good, assets loaded and all pages accessible, including admin. 3 - I did another test, changed the base on .htaccess to /devel/ and all was good too. http://pw-multilang.dev/devel/ kept working. ---- Did you do anything else I didn't?
    1 point
  36. Thank you for the directions. Exactly what I needed. I just re-installed the multi language option. Renamed the default language English (en) to Dutch (nl). Installed a dutch language pack over the old English one. Deleted the German and Finnish pre-installation and I installed French as the second language. Before I forget: I changed the page names on the homepage too (in the settings tab). Except for some minor translations issues that can be fixed, there is no sign of English anymore.
    1 point
  37. Fair enough - I don't honestly change the settings very often at all so I didn't think it was a big deal. I don't honestly think it's worth hacking on something to remember the state of a fieldset after saving (although I do think it would be a nice core addition). For the moment I have set all fieldsets/sections to be open by default. I think just having the fieldsets defined really helps to categorize the settings anyway. I have made those tweaks the s/KB items - thanks. I have also just added a couple of other new things that continue to improve page load speed. Debug panel now by default respects the $config->debugTools setting. You can configure this to show all regardless of the setting if you wish. This has the potential to speed this panel up significantly if you don't display all the tools. Button to "Delete Logs" on the the Tracy Logs panel. This panel can start getting quite slow if you send lots of PW objects to the log files, so this provides a quick/easy way to delete them all and get the panel running fast again. With the changes from the last couple of days, using the defaults that are set when installing Tracy, I am seeing a less than a 100ms increase in page load time with vs without Tracy enabled. I am pretty happy that it's now running really fast and shouldn't be noticeable. If anyone is still having significant slowdows, please try it without SessionHandlerDB installed and also completely disable xdebug and let me know if that makes a difference - thanks!
    1 point
  38. you can do it after the install, if you have installed a single language site profile. Most of us have created their personal starter site profile, I think. It has all settings for default language (inkl.language pack), and the modules, one never can miss, etc. To export a site profile is easy with the site profile exporter module.
    1 point
  39. Yes, of course, nice! Haven't got into taxonomy yet but the powers of PW are revealing themselves in a most pleasing way. Everything so far seems quite sensible with no outrageously complicated abstractions (looking at you Drupal 7).
    1 point
  40. Now add a label to the "blog-entry" template so that it reads "Blog Entry" or "Blog Post" or whatever you want.
    1 point
  41. Nice, now you have found it. I have posted a link to another explanation for the rescue. But you don't need it anymore.
    1 point
  42. Yes it does. Now I know there are different icons, I can see that that 'Add new > Blog...' has an arrow. So what I've done now is the following, which works automatically which is awesome and just what I wanted. I had only set the (child) relationship on blog-index.php, but it seems you also need to set the (parent) relationship on blog-entry.php so the system knows this page can only go in one place with no ambiguity. This is an educated guess but any other method I tried (setting just one or the other) resulted in 'Add new > blog-post' disappearing out of the menu.
    1 point
  43. I see, and the little tick is present. Working now. Yep, done this bit. Doh! I thought it was automatic for some reason one the relationships were set up. So it works now, but it's not intuitive enough for a client. See the screenshot. 'Add New > Blog...' They wouldn't be adding a new blog, just a single post. Not really what I had in mind, should really say 'Add New > Blog entry'. I see it's using the 'title' field of the blog-index.php template, which is simply 'Blog'. If I change this to 'Blog post', the shortcut becomes 'Add New > Blog post' (but the displayed main title on the webpage also becomes 'Blog post', and the main navigation entry etc...). So, I thought maybe I could create a new field called 'shortcutText' in blog-index.php and use that to display whatever I wanted. However, not sure how to get the text into that dropdown seeing as it's using the 'title' field. That make sense? How do you guys handle this? Thanks for the replies so far, it's really helpful to get me up and running.
    1 point
  44. hi jmartsch, you can use the modal directly. see here for docs: https://github.com/ryancramerdesign/ProcessWire/blob/master/wire/modules/Jquery/JqueryUI/modal.js#L10-L44 then you can do something like this: <a href="/admin/page/edit/?id=1246&fields=title,user_image,facebook_url,description" class="pw-modal" data-buttons="#submit_save" data-autoclose>test modal</a> <script type="text/javascript"> $('a').on('pw-modal-closed', function() { $('body').prepend('<div id="reload" style="width: 100%; height: 100%; position: fixed; z-index:9999; background-color: rgba(255,255,255,0.5); display: none;"></div>'); $('#reload').fadeIn(); location.reload(); }); </script> now you just have to make sure that all the necessary files get loaded by having <edit title></edit> anywhere in your html markup!
    1 point
  45. Yes, I think so. You may have good reason to develop locally in a subfolder, but I generally find it's easier to set up a virtual host for each project and then develop in the root of that virtual host.
    1 point
  46. I remembered a blog post where Ryan introduced a new function wireRenderFile() for rendering a file and returning its output. But when I searched the new v3 API docs I couldn't find wireRenderFile() - instead I discovered $files->render() and WireFileTools::render() that seem to do the same thing as wireRenderFile(). And looking at the code it seems that wireRenderFile() is basically an alias for $files->render() which in turn is a shortcut to TemplateFile::render() see edit below As a learner developer all of this got me wondering: 1. What is the benefit to making a new function like wireRenderFile() that seems to be just an alias for an existing method? I know there must be one because otherwise it wouldn't have been announced as something new in Ryan's post. 2. Is there a significant difference between WireFileTools::render() and $files->render()? The API docs say they are both shortcuts to using the TemplateFile class but unlike wireRenderFile() it looks like the code for WireFileTools::render() is not just an alias for another method but is actually independent. see edit below Edit for posterity: I think I have it sorted out in my head now... wireRenderFile() = $files->render() = WireFileTools::render(), and WireFileTools::render() makes use of TemplateFile::render() as part of the method.
    1 point
  47. Thanks for the replies. I licensed FontPrep years ago when it was a closed-source app, and even bought an old Macbook especially to run it on (I'm a PC user normally). The downsides to FontPrep are bugs, no WOFF2 support, and the fact that subsetting has to be manually specified for each individual font. But is seems like it's just about the only show in town for desktop webfont conversion with a GUI (the only other alternative I can see is TransType which doesn't even do subsetting). To be honest I think the main reason I don't use it routinely is the hassle of booting up another computer for a single task. And that's just laziness so I'll give it another look now that I'm running into problems with Font Squirrel. Thanks, I've used both of these in the past. While neither has anything like the feature set of the Font Squirrel generator and Fontie has no WOFF2 support they do at least work for the wrongly-blacklisted fonts. Transfonter is my pick of the two because it generates WOFF2 and allows the conversion of multiple fonts simultaneously. It does surprise me that there aren't more offerings for quality webfont conversion. It's something I'd happily pay for. I'd love to know how much market share the Font Squirrel generator has. Seems like a lot of eggs in one basket - if they shut up shop for one reason or another it would be a minor catastrophe.
    1 point
  48. in my case the two templates are 'blog' and 'blog-post'. 'blog' is the parent and only used once, while blog-post is the child and used many times. In the 'Family' tab on the template page for 'blog-post', I have things set up as in the attached image. This template cannot have children, but can be used for new pages. Its only allowable parent is 'blog'. If you go on the 'blog' template, the dropdown for allowed chidren will have a tick (checkmark) against 'blog-post'. This relationship between templates only needs to be set from one side to work, and I usually do it from the child template since it is when I am editing that that both sides of the relationship exist.
    1 point
  49. To be completely fair, it is a part of the core and it doesn't require a module The easiest way to handle this is to create a page to contain images (or multiple pages, separated into categories, or whatever) and then, when embedding an image, choose to use an image from one of these pages instead of the current one. That's just about it. The modules that handle something like this are largely just layers of abstraction built to hide the underlying concept from the end user. Sure, if your needs are massive then you might require a more complex solution to solve them, but something as simple as reusable images are very easy to set up using nothing but the tools that ProcessWire already ships with
    1 point
  50. Probably not relevant in your case, but just an FYI, array_filter considers zero values as empties...Will be a gotcha in use cases where you actually want zeroes
    1 point
×
×
  • Create New...