Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 12/31/2015 in all areas

  1. ** replaced with this: https://processwire.com/talk/topic/11817-module-adminhelp/ ** This is a new module, work in progress/alpha (not for use on live site): [github link deleted] AdminDocsTab module for ProcessWire Processwire helper modules for managing site documentation. Instructions This is a helper module which expects you to have already setup a hidden part of your page tree to establish your documentation, using any template (e.g. 'docs') and a body field (ckeditor). The docs template does not need to have an output template, as the module will only echo the body field inside the admin. In addition this 'docs' template will require a template select field (separate module: FieldtypeTemplates) which should be named template_select. Once you have setup your docs template, template_select field and some docs pages, you should install the AdminDocsTab module, then select the template(s) to show the docs on, as well as the root page of your docs. At this point the 'Docs' tab should show up for the relevant template (as specified in the Doc), and show the docs that have that template specified. To have a global docs overview page (e.g. 'Docs'), which renders all of the docs in an accordion view, you can install the ProcessDocsView module, which will setup a page to view the docs (under Setup).
    6 points
  2. Hi Jones, and welcome to the forum. If I understand your question correctly, adding HTML markup within and SVG element is a front-end issue (therefore not related to ProcessWire) and quite a bit more complicated that it looks. There are, however, many references available from a google search regarding SVG <text>, or CANVAS, etc., which would be a great starting point for you. Since ProcessWire does not restrict you on what or how you create your user-interface, I would recommend you first create the front-end and get it working the way you desire. We could then help you with having ProcessWire manage that information. You will have to determine the best way to accomplish your goals, but you might look at either the TSPAN var text = svg.append("svg:text"); text.append("svg:tspan").style("fill", "red").text("hello"); text.append("svg:tspan").style("fill", "blue").text("world"); Or an foreignObject element: svg.append("svg:foreignObject") .attr("width", 200) .attr("height", 200); .append("div") .html("<span style='color:red'>Hello</span> <span style='color:blue'>world</span>!"); Or even an absolute-positioned HTML overlay. Edit: @Mods: Should this be moved to off-topic?
    4 points
  3. Still a while away here in South Africa (and it's really hot here today, 31°C with almost zero wind), but just wanted to wish everyone a happy New year before I head off for celebrations. Hoping 2016 will be a prosperous year for all!
    3 points
  4. Show off . Here It's a mild 11°C with almost 25 mph wind Happy new year!
    3 points
  5. Thanks! Happy New Year to everyone! Be safe! I want to see everyone back here!
    3 points
  6. Another approach can be to setup a dev-subdomain on your online hosting provider and use an editor that provides editing of those files directly via ftp(, sftp, ftpes) behind the scenes. This has been discussed sometimes here in the forums too. Good google searches for that can be: site:processwire.com/talk -"Viewing Profile" mac editor ftp It depends on your hosting account, if there are resources for: 1 additional DB and the possibility to create subdomains, e.g. a dev.example.com besides the www.example.com.
    2 points
  7. This is a reworked website of Imre Baksa, a Hungarian actor and director. His former (static) website was also made by me back in around 2009. He asked me to do a redesign but I decided to involve ProcessWire to make content management easier. http://baksaimre.hu/ Lesson 1: templates - no thanks It is tempting to use ready-made templates for a project because most of the work is done, there's some tweaking here and there and mission completed. Okay, this is the theory. I have to admit that I have never found a suitable template/theme for my projects, but being a web designer this is the way it should be, I guess. This time I found one that looked fine: Landed from HTML5 UP. In fact there was a self-made design for the site and this template looked 90% similar, so it really seemed to be an easy task to bring it into ProcessWire. Soon turned out that some of the fancy features of the template required advanced JavaScript knowledge. That means, I had to dive into it and learn how it worked. I did so and I was able to tweak things then, but I wasn't satisfied with the outcome. So I went back to the drawing board and dropped the template. This experience reassured that starting from scratch would have been a better choice on the long run. The good thing is that I learned some new things that will come in handy in the future. Lesson 2: template engines - Latte is still my best friend I was using Nette's templating engine, Latte in previous projects and I liked it a lot. It is similar to Twig, which is more widespread, so I decided to try that for learning purposes. This sounded like an easy journey because ProcessWire supports Twig through modules. However, at the end of the day I sort of regretted that. Latte has some small helper features that makes templating easier, and these differences made up a huge difference. Maybe I'm getting old but I felt Twig more of a nuissance after Latte. Finally I got rid of Twig and I guess I will never look back I will keep using Latte in the future even if I have to bootstrap it manually. Lesson 3: frontend development is hard Having ProcessWire at hand, backend is the minor part in web development, at least in smaller projects. I've used only a few jQuery plugins but making them work together nicely was a real challenge. At the end I had to make a compromise by removing SmoothScroll because it didn't work well with JScrollPane. Even so, I had tough times to eliminate content "jumps" when a lightbox is opened, and to make JScrollPane work the way I wanted to work. Making the whole thing responsive added another level of complexity as features needed to be destroyed/reinitialized on different screen sizes. I like to polish things as much as possible but the current state of the web makes it almost impossible to reach certain level of perfection. Moduling up This was the project where I felt that a link checker button would be helpful so started to develop InputfieldURLChecker. I use this in a few projects and it does the job nicely. My other pet PW module FEEL also got some polish during site development. For site-wide settings I used MultiValueTextformatter so I didn't need to create a field for every setting, just one for all. Other modules used: SEO: must have! Admin Template Columns for better admin layout Page List Image Label: to add featured image to the list of pages in the admin Pageimage Remove Variations: remove unused image variations Forms: one step closer to simpler form processing For the contact form I used Nette Forms, because it is so easy to add forms to the site with it, with frontend & backend validation in one go. Processing them still needs some sweat, but this time I finally put together a class to make this easier. Surely it still needs some iterations but it's a huge help: it takes only a few parameters to save submissions as Pages or send email to the admin or the visitor. For email templates I also used Latte (what else? ). I also created a "json_storage" field to store submission. The beauty is that while it's only one field (a textarea), in the admin it is displayed as formatted key-value pairs using a hook. Summary The site looks fresh and the year knob on the left makes it fun to use. Content management is easy as 1-2-3 thanks to ProcessWire, even if it's mostly me who will deal with the updates. While it's not visible on the site, in the background there are many improvements to my development tools and workflow that will be of huge help in the future.
    1 point
  8. This is a very simple way to display some instructions to the admin users. Before starting, you need to write some docs; they can be a hidden branch of your page tree, using basic-page, or a different template of your choosing. You should make each subject it's own page under the docs so you can output each one under an accordion trigger. Required Module: Admin Custom Pages 1.) Follow all instructions to install the module; Also add the ACP_scripts_and_styles field to the admin template. 2.) Make a new page under admin, called Docs or whatever; assign the process as described in the module instructions. 3.) Make a template in your themes directory to generate the output of the docs page. 4.) Select that template from the page select in the admin custom page you created. 5.) also make a folder to keep your admin custom pages scripts and styles; 6.) create a css file to use for the display output and some basic styles (like ol, ul li etc..) 7.) Add the custom css file to your ACP_scripts_and_styles field. You can use any output you want, but i'm using a nested accordion, which is provided here: http://tympanus.net/codrops/2013/03/29/nested-accordion/ this is the content of the admin custom page: <?php $docs = $pages->get(4259); ?> <div id="docs"> <ul id="cbp-ntaccordion" class="cbp-ntaccordion"> <?php foreach($docs->children as $doc) { ?> <li> <h3 class="cbp-nttrigger"><?php echo $doc->title ?></h3> <div class="cbp-ntcontent"> <?php echo $doc->body;?> </div> </li> <?php } ?> </ul> </div> <script src="<?php echo $config->urls->templates ?>_admin_custom/js/jquery.cbpNTAccordion.min.js"></script> <script> $( function() { $( '#cbp-ntaccordion' ).cbpNTAccordion(); } ); </script> you'll also want to add the provided css, js and fonts that come with the Nested Accordion; in the css file you'll need to point the fonts to the actual font directory, for example: /site/templates/_admin_custom/fonts/icomoon_arrows/icomoon.eot it should come out looking something like this: *if you are using Reno theme, you can customize the icon, like for example fa-book, which is used in this example: -- Thanks & Credits to Diogo for originally creating the ACP module, and for Nico for getting it to work with the new admin theme system...
    1 point
  9. ok this is finally a module under construction https://processwire.com/talk/topic/11803-admindocstab/
    1 point
  10. In short: nearly nothing more! If you have an exact copy of your origin Database as second DB you only need to change the credentials in site/config.php to point to the dev-DB. Besides that, you should copy the index.php, .htaccess and complete wire and site folders to the dev.domain. That's it!
    1 point
  11. Thank you very much Cerulean (and the others too), the custom JS styles are exactly what I was looking for!
    1 point
  12. Thanks a lot. This is all great information. I think I'm going to try going the route you suggest, Horst. I followed a couple of those relevant threads and think I'll start exploring some of those tools. It seems like a solution I can wrap my mind around, and a cleaner way of doing what I'm already doing.
    1 point
  13. Hi jon9china, Martijn wrote a great tutorial about a setup which works great. I use the same configuration with a few minor tweaks, but it has been running smooth for more than a year. When running a newer version of Mac OSX you might want to tweak some stuff since Apache has been updated to 2.4.
    1 point
  14. Just to expand on this a bit: unlike the standard CKEditor image plugin, the PW image plugin does not provide a text field where you can type in a class for the image. So you would need to add "img-responsive" to a custom JS styles set and apply the class to the image using the styles dropdown. Info on how to load a custom style set is here. If you want the "img-responsive" class to be applied to every image in your CKEditor field (so you don't have to manually add it to every inserted image) there are a couple of options: 1. Add the class client-side with jQuery. This is a nice easy option. For example if your body text is inside a div with the class "body"... $(".body img").addClass("img-responsive"); 2. A little more challenging but no big deal if you're comfortable with PHP... create your own text formatter module that adds the class at runtime.
    1 point
  15. I found this one to be the easiest to use: https://www.mamp.info/en/ You can find a lot of tutorials on the net on how to set it up. There are alternatives too, for example: https://www.apachefriends.org/hu/ Edit: and if you want to move it later on: https://processwire.com/docs/tutorials/installation-moving-and-troubleshooting/page5
    1 point
  16. Thanks guys. Yeah, figured I'd make use of the domain - at $2, it feels like a gift.
    1 point
  17. There could be a situation where you want a Page with the following: it's published it's hidden it's template has a php file it SHOULD NOT be available to viewed on the frontend using it's URL Now you might be thinking "Well if you don't want it to be viewable on frontend, then just delete the template php file!"... however the purpose of wanting to have a template file could be for partial/section rendering. This is a pattern that I personally like to use. Here's a perfect example... let's say you have a page called "About Us" and it has 3 sections that make up the page. Based on how you want to structure that page, you decide that those 3 sections will be stored each as a child page of the "About Us" page, but when the "About Us" page is viewed, the page is built based on those 3 child pages (using a simple loop). So, we can give this as an example: /about/ (about.php)/about/philosophy/ (section-type-1.php) /about/mission-statement/ (section-type-2.php) /about/some-other-section/ (section-type-1.php) and in about.php, you might have something like this (using direct output)... <?php foreach($page->children as $section): echo $section->render(['prependFile'=>'']); endforeach; ?> and in section-type-X.php you would have just your partial markup: <section class="section-template-<?php echo $page->template; ?>"> <header> <?php echo $page->title; ?> </header> <?php echo $page->body; ?> <!-- etc... --> </section> So the above works fine, but those child pages can still be accessed if the direct URL is known. The way around this is one of the following: Option 1: In the partial file, detect if the page is being hit directly, as opposed to being rendered from another template like we are doing. If it it being hit directly, then redirect somewhere or throw a 404. You could do that by adding the following to the top of section-type-X.php. <?php // the pagestack is empty, which means the user hit this template file directly. if( empty($options['pageStack']) ): throw new PageNotFoundException(); // show 404 page endif; ?> Option 2: Don't assign an actual template file to the section templates. Instead, use a partial file approach So, you would rename section-type-X.php to _section-type-X.php (notice it starts with an underscore). Then in about.php, you would use wireRenderFile/wireIncludeFile. But now that I think about it, how would you best associate a section page with a template? -- Anyway, hopefully the scenario I outlined above helps someone. This occurrence, perhaps unbeknownst to @teppo may be happening on the weekly.pw site. For example, if you Google for just one Issue (let's say #32), you get the URLs not only to Issue 32, but the page sections that make up that issue: https://www.google.com/search?q=site%3Aweekly.pw%2Fissue%2F32%2F Results: https://weekly.pw/issue/32/ https://weekly.pw/issue/32/latest-processwire-core-updates/ https://weekly.pw/issue/32/new-module-service-ip-geolocation/ https://weekly.pw/issue/32/processwire-resources-of-the-week/ Is that a bug Teppo? You may get docked for duplicate content depending on how you are handling canonical URLs.
    1 point
  18. What @Martijn said....but I'll attempt a guess If you are talking about a HTML class to add to your uploaded images (uploaded in a page edit session) to target with your CSS, ProcessWire doesn't output markup so you will have to add those on your own at runtime, e.g. $out = ''; if(count($page->images)) { foreach($page->images as $image) $out.= '<img src="' . $image->url . '" class="myImageClass">'; } echo $out; If you are talking about images you insert in the RTE, you can use the RTE to add your classes Welcome to PW and the forums
    1 point
  19. I'll second that. Nice work on the new .pw domain
    1 point
  20. It's a really nice documentation site - much appreciated.
    1 point
  21. It's on its way, in a form of a site profile. I wanted to start it in these days but got some hardware issues to solve first.
    1 point
  22. Hey Ivan, You are quite right about the previous discussion. Requests to /index.php/something will be seen as requests to the home page by processWire, unfortunately. As such, the only solution I have for this is to create a new setting in the module's configuration that tells Jumplinks to not redirect /index.php requests to the root and not redirect /index.php/* requests to /index.php.pwpj/*. Sound good to you?
    1 point
  23. Update: Repo has been moved over to http://github.com/rockettpw/jumplinks and its documentation now lives at http://rockett.pw/jumplinks
    1 point
  24. I was struggling a bit getting all subfields of a field if type is unknown. I made a small function for use in templates which returns an array() of all properties of (maybe any?) pagefieldvalue. If there is something similar in core (which I couldn't find) please let me know. Tested it with Fiedtype Options, Page, ProfieldsTable. Feel free to use it. /** * ProcessWire UsefulSnippets * * How to get all properties, subfields of any field if you don't know the type only if value is set * @return array */ function getProperties($fieldvalue) { // multiple value field if ($fieldvalue instanceof WireArray) { $result = array(); foreach ($fieldvalue as $subfieldvalue) { $result[] = getProperties($subfieldvalue); } return $result; // single value field with subfields } else if ($fieldvalue instanceof WireData) return get_object_vars($fieldvalue->getIterator()); // single value field else return $fieldvalue; } // Example var_dump(getProperties($page->myfield));
    1 point
  25. Table Use this for tabular data, like rate tables or other things that you might typically represent in a spreadsheet. Use it for situations where you don't need the full-blown flexibility of repeaters, as it's technically more efficient with far less overhead than repeaters. Something like the Events Fieldtype could be very easily re-created via a Table field, but the potential uses are far broader. But for the most part, think tabular data when it comes to the Table field. Multipliers This is good for when you need a range of values (whether text, textarea, numbers, dates, etc.). If you are using repeaters with just one field in them, you might be a lot better off with a Multiplier. Like the Table field, Multipliers are very efficient and low overhead relative to something like Repeaters. Use Multipliers when you need to repeat a single input multiple times, optionally with a min and max number of inputs. Lets say you are building an employee directory, and each employee has between 1 and 3 email addresses. Rather than using 3 separate email fields, you would use 1 multiplier field and specify min=1 and max=3. Repeaters These are infinitely flexible in terms of what they represent, but each row of values is technically a page in the system. As a result, with the flexibility comes significant overhead. This is really only an issue when the quantity of repeater items gets high, or when you have lots (thousands) of pages using repeaters. I recommend repeaters for setting up things like homepage carousels. For example, if you go to the Villas of Distinction homepage, there are 3 separate repeaters in use on that page, each holding a photo, title, description, link. The client can have as many items in each of those sections as they want. Currently it looks like the first repeater as 6 items, the 2nd has 2, and the 3rd has 6. The possibilities of what can be represented with repeaters is endless, but look for potential alternatives when dealing with large quantities (whether large quantities of repeater items, or large quantities of pages using repeaters). PageTable This is one of the ProFields that is available for free (thanks to Avoine sponsorship) on the ProcessWire dev branch. Meaning, it'll be available for everyone to use as part of the core in ProcessWire 2.5. And you can use it now if you don't mind running the dev branch. PageTable has all the flexibility of repeaters, but with lower overhead from the admin/input perspective. Rather than trying to bundle all the inputs on one screen, PageTable shows you a table of items and you click on the item to edit it in a modal window. This enables it to be a lot more efficient from the admin UI perspective. It's also more flexible than repeaters are in terms of where you store your items. PageTable lets you choose where they should live, whether as children of the page being edited, or as children of some other parent page you designate. They might be a little more work to setup than repeaters, but I think that most situations where you need the flexibility of repeaters may be better served by PageTable. PageTable still can't compete with the speed and efficiency of Table or Multiplier, but consider using PageTable anywhere that you might have used Repeaters before. Repeaters and PageTable are fundamentally different from the admin UI/input perspective, so you'd want to compare them yourself to see what suits your individual input needs better. PageTable involves more clicking to create and edit items, making Repeaters potentially faster for entering data rapidly. But PageTable will scale much further in the admin UI than Repeaters will, so I would personally favor PageTable in more situations than Repeaters.
    1 point
  26. That error is caused by the fact that you run this file without involving ProcessWire at all. You can't just run template file "standalone" and expect it to automatically load ProcessWire, you know Solution @horst provided above is most likely what you need here (or external / real cron job instead of this awfully limited scheduler thing you're using now). Then again, if this is the only reason you need that template, i.e. it doesn't need to be web-accessible, you could forget whole template and page thing and simply place a PHP file somewhere your scheduler can access (such as your PW root directory) and in that file bootstrap PW and write any program logic you need. Point your scheduler to that file and you're all set.
    1 point
×
×
  • Create New...