Jump to content

Macrura

PW-Moderators
  • Posts

    2,756
  • Joined

  • Last visited

  • Days Won

    40

Posts posted by Macrura

  1. hey i'll add to the rant

    @totoff  - you mean themeforest i think ?

    i think the prefabs are necessary for some devs and users, and for certain projects; I'm a sworn PW user, but i have a site running joomla because there is a really good invoicing system called nBill; and some CMS have advanced prebuilt addons (a.k.a. plugins/modules/components etc..) like community, calendars etc.; so you have to do research and consider budgets before you choose the cms for the project. When you can use PW you'll be relieved, it has the best admin UI hands down of any CMS.

    i just got done converting a wordpress template, one that I liked a lot, to use in a processwire site – it was really educational;
    i was able to see how the wp theme was coded and it wasn't a pretty site. Tons of code bloat (but all necessary to make the theme usable to a wide audience);

    and then i was able to go and attain all of the functionality of the wordpress version and more using 1/20th of the code; and i'm able to do really cool things now with the content management, media (audio, video) that would be completely impossible in WP, or would be a ridiculous hack job...
     

    • Like 3
  2. Hi Wanze - many thanks - great and simple solution, nice thinking!

    here is how i finally implemented:

    <?php 
    $tags = $pages->find("template=tag");                   
         foreach($tags as $tag) {                    
         $c = $pages->count("template=audio, tags={$tag}");
         if ($c == 0) continue;
     ?> 
    //filter <li> markup here 
    <?php } ?>
     
    • Like 2
  3. Hi all, i think i need some help with this:

    I have a field called Tags, which is a pageAutocomplete field, and allows the user to enter tags for a page;

    Then on the template i have an isotope display which has a filter, using the tags;

    Right now i'm just cycling through the tags (selector for template=tag) to create the list of filter links;

    but is there a way to check that a given tag is actually in use, by a page, since right now if someone enters a tag and then deletes it, that tag is still a tag page, but if you click on that filter, no items are displayed...

    TIA

  4. Hi Basil,

    processwire is great, but it's not going to be a turn-key solution like wordpress, joomla etc.. you will have to know a bit of php to really make it work;

    I would recommend to spend some time reading the forum, all of the documentation, as well as Joss' great tutorials; and also check out the cheatsheet. You'll also find that reading through the code in the different site profiles will give you some answers.

    i think i spent about 1-2 month reading the forum before i actually tried to make a site with pw.

  5. keep everything in your template the same, delete the slideshow items, then get your sideshow items from pw into an array, then cycle through them in foreach, sort of like this (this is untested psuedo-code, just to give you an idea)

    <?php 
    if(count($page->images)>0) {
        foreach($page->images as $img) { ?>
    
                            <li>
                                <a class="thumb" name="drop" href="<?php echo $img->url; ?>" title="<?php echo $img->description; ?>">
                                    <img src="<?php echo $img->url; ?>" alt="<?php echo $img->description; ?>" />
                                </a>
                                <div class="caption">
                                    <?php echo $img->description; ?>
                                </div>
                            </li>
     <?php }} ?>
    
  6. Yeah, the flexible content is kind of cool if you have situations where you have a lot of pages that don't all really conform to any single template, but most of the time when you have your content really well structured, and analyze what the output needs to be, you might find that this type of thing is really not necessary;

    if your needs are not that complex you could create a sort of generic repeater, where there is a select list for what is contained in the text area, like content, teaser, etc. then you could check the value of that select field and output the markup accordingly.

  7. Huh, why don't you also use MarkupSimpleNavigation with a little smile ;)

    You can also include hidden pages if you add the selector "include=hidden". If that helps.

    this is definitely *THE WAY* to make a sitemap...! Thanks...

    spent a long time trying to make a 3 column sitemap using CSS3 column count, however it will not work if you have home as a 'parent' <li> to the rest of the list, because the browser will keep all of the child items of that <li> in one column... with the MSN module, you can prepend the homepage, so it is in it's own <li> on the same level as the rest of the site...

  8. Thanks Ryan -

    I think i will use the redirect template idea for some things..Right now there are no multiple URLs, everything is well organized in the page tree, diescrreet

    now you're giving me some ideas about how to improve this – right now the products are arranged heirarchially under one parent, and then 4 'categories' with all of the products under each of those; But now i'm thinking that ALL of the products should have the same parent, i think this will make it more flexible to show search results.. then i guess i'll use URL segments for the product category, application, name etc...if i do it this way, there will be multiple URLs to the same page, but i could then use canonical URLs;

    • Like 1
  9. Hey Ryan - thanks for replying to this.

    RIght... i think in most cases using the PW tree to generate the menu is best; But it does speak to the flexibility of PW that you can do something like this with relative ease when required...and in setting this up I learned from Soma's bootstrap menu markup how to generate complex nav markup without using a plugin..

    I have heard it said somewhere that the navigation menu should be optimized for the user and not be constrained by the hidden structure of the site, especially for larger sites. In this case, it is a company where many of the products overlap in functionality, so there needs to be several routes for different users to arrive at certain pages.  And they are not extremely organized yet about the content, so i'm sort of dumping all of the content into the tree in what seems like a logical structure, and then linking to things as necessary, with the custom menu.  It's also helping to prevent confusion in some cases for links to external sites, where those would have been showing in the page tree if we did it that way.

    This site will also have a lot of advanced search and filter types of things, so the nav is kind of secondary to that route for finding pages...

    -marc
     

    • Like 2
  10. Recently I've been working on a site where it seemed like it was going to be impossible to keep the page tree and the needs of the site's main menu in harmony;

    So to solve this I setup a separate page tree under a hidden page called 'Main Menu', with each menu item having three fields: title, menu-link-page, and menu-link-url. All of the menu items are also hidden, so the code below uses the include=all parameter when getting the pages for the tree.

    To generate the main menu markup, i adapted the great code that was developed by Soma for Joss's bootstrap menu, and modified it to output links to the menu-link-page or menu-link-url; (Entering a value in the menu-link-url field overrides any selection in the menu-link-page.)

    This solution has enabled me to setup the menu exactly how the site needs it, even if the menu heirarchy is not the same as the page heirarchy, and has solved a lot of problems and made things easier for this scenario. For example, menu items can easily contain external URLs, to subdomain pages, or other related site's pages. (In this case the client has a separate web store for selling parts). Also, all of the parent menu items had to use a javascript:void() as the href, in order for the accordion version to work right on mobile; So this was easy to do by putting that into the menu-item-link field.

    In the code below, page #1271 contains the menu tree, so it is specified as a parameter to the $root variable.

    I think this sort of setup, using a custom menu tree, could solve a lot of the questions I've seen recently on the forum; I probably wouldn't use this technique on small sites since it is more work, but for larger ones where you might need a lot of menus, this could be helpful.  Also, if you had to setup a Mega Menu, with images and icons, this might make it easier to manage.

    <?php
    
    /**
     *  render custom markup menu for bootstrap nested navigation
     *
     * @param  PageArray  $pa     pages of the top level items
     * @param  Page  $root   root page optional, if you use other root than home page (id:1)
     * @param  string  $output for returned string collection
     * @param  integer $level  internally used to count levels
     * @return string          menu html string
     */
    function renderChildrenOf($pa, $root = null, $output = '', $level = 0) {
        if(!$root) $root = wire("pages")->get(1);
        $output = '';
        $level++;
        foreach($pa as $child) {
            $class = '';
            $has_children = count($child->children('include=all')) ? true : false;
    
            if($has_children && $child !== $root) {
                if($level == 1){
                    $class .= 'parent'; // first level boostrap dropdown li class
                    //$atoggle .= ' class="dropdown-toggle" data-toggle="dropdown"'; // first level anchor attributes
                }
            }
    
            // make the current page and only its first level parent have an active class
            if($child->menu_item_page === wire("page")){
                $class .= ' active';
            } else if($level == 1 && $child !== $root){
                if($child->menu_item_page === wire("page")->rootParent || wire("page")->parents->has($child)){
                    $class .= ' active';
                }
            }
    
            $class = strlen($class) ? " class='".trim($class)."'" : '';
            if($child->menu_item_url) {$childlink = $child->menu_item_url; } else { $childlink = $child->menu_item_page->url; }
            $output .= "<li$class><a href='$childlink'>$child->title</a>";
    
            // If this child is itself a parent and not the root page, then render its children in their own menu too...
            if($has_children && $child !== $root) {
                $output .= renderChildrenOf($child->children('include=all'), $root, $output, $level);
            }
            $output .= '</li>';
        }
        $outerclass = ($level == 1) ? "accordmobile" : '';
        return "<ul class='$outerclass'>$output</ul>";
    }
    
    // bundle up the first level pages and prepend the root home page
    // $root = $pages->get(1);
    // $pa = $root->children;
    // $pa = $pa->prepend($root);
    
    // Set the ball rolling...
    // echo renderChildrenOf($pa);
    
    // example with pages further down in the tree
    
    $root = $pages->get("1271");
    $pa = $root->children('include=all');
    // $pa = $pa->prepend($root);
    
    // add the root as the second parameter
    echo renderChildrenOf($pa,$root);
     
    • Like 3
  11. since i've done this kind of thing a lot, the first thing i notice about your setup is that you are using an image field within a repeater, but the image field already supports multiple images, so if i was doing this, i would not use a repeater, but just a plain image field, that allows multiple images.

    if you are only going to have 1 featured project, then this should work, assuming you don't put the image_field inside a repeater:

    $featured = $page->featured_project;

    $img = $featured->images->first();

    $thumb = $img->size( 100, 100 );

    • Like 1
  12. I've been seriously researching the options for digital products (e-goods) since we have several record label clients running stores that sell music downloads, and we're attempting to migrate away from Joomla, where we have been using a component for this.

    So far my experience with Ecwid has been great - the pricing is very reasonable, they have a free plan, and everything seems to work well;

    For e-goods, you get 100 products, unlimited storage and bandwidth for $15/month. The only issue is the 100MB max on the filesize, but there are ways around that, such as splitting large files into multi-part archives, however this can be less than convenient for the end user than just getting the complete file.

    Ecwid integration with processwire is nothing; the only thing that could get tricky involves the SEO with ajax, and they have instructions for how to get this setup right; Most people would have a separate page for each product in PW anyway, so that wouldn't be an issue.

    the other e-goods options I have looked at include:

    http://www.fetchapp.com

    https://gumroad.com/
    http://quixly.com/
    http://pulleyapp.com/

    Fetchapp's pricing (http://www.fetchapp.com/pages/plans) can't really compete with Ecwid, unless you use the $10 "use your own server" plan, and then host the files on s3. I think one advantage of fetchapp is that it can host larger files without breaking them up; The only other thing is that Fetchapp is digital goods only, while Ecwid can do both digital and physical..

    Gumroad looks cool- there is no monthly fee, and you don't need to have a payment gateway, like PayPal...

    this article was kind of helpful...

    http://www.smashingmagazine.com/2012/03/29/selling-digital-goods-online-e-commerce-services-compared/

    -marc

    • Like 2
  13. Hi Luis,

    this is my temporary solution - it works for now, but i'm thinking i should do this with a session variable so that if the user refreshes the page or navigates away, and comes back, they don't have to re-enter the password; Also i need to provide an error message... thanks again for your help; I'll see if i can improve my knowledge/use of the api with respect to $input and $session...

    <?php
    if($page->album_password) {
    
       $pass = $page->album_password;    
       if($input->post->pass != $pass) { ?>
    
       <!DOCTYPE html>
       <html>
       <head>
       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
       <title>Login to view <?php echo $page->album_title ?></title>
       </head>
       <body>
    
           <form method="post" action="./" accept-charset="UTF-8">
               <input type="password" id="pass" name="pass" placeholder="" />
               <button type="submit" name="submit" class="btn btn-success btn-block">Login</button>
           </form>
    
       </body>
       </html>
    
       <? } else {
       include("./inc/album.inc");
       }
    
       } else {
       include("./inc/album.inc");
       }
    ?>
  14. Hi Luis,

    I've almost got this working, the main issue now is that the code seems to loop, and also i was getting an error because of the unmatched brace on the } "// end !logged in" line... maybe that's why this is not working?

    so after you click the login button, you keep getting back to the login page, i guess because since it is all on the same template?

    I tried an alternate idea of having only the login code on the template and then including the markup code for the page, contingent on being logged in, which works;

    but i'm not sure this is necessary - and with this method i can't figure out how to throw the wrong password error...

    thanks again for your advice and the code!

    -marc

  15. Hi Matthew - thanks - yes i have a policy where i will only do sites where someone associated is a Sopranos double; ;)

    And you're right about those little grey boxes, the font is a bit small...I'll have to mention that to the client..

    Oh - and to follow up about Joomla expats...easy way to identify us, we all look quite relieved.

  16. It would be 1 password to access the album, everyone with the password would be able to access it;

    this will be on a non search indexed subdomain of their main site, the links only given to the various press/reviewers.

    after the promo period, they would unpublish the page, and we would use the redirects module to send incoming requests to a contact page;

  17. I have a client who is a record label and they need to have some pages for promoting albums, where there can be a password they give to a reviewer, so the reviewer can go to the URL, type in the password, and be able to view the content (which will be streaming audio and downloads of the album in question).

    i have found some simple ways online to do this with PHp, but i'm wondering if there is a better/simple way to interact with PW session to achieve this.

    The client doesn't want to have to add roles/users or deal with permissions...they just want to have an input field where they can put in the password for that album...

    TIA,

    Marc

  18. thanks all for taking a look at this.

    As i said, this was the first PW site done for a client, and despite the learning curve, it all went relatively fast, and what was especially important was how i was easily able to respond immediately to any request the client had; is seemed that the answers to virtually all of my questions were already in the forum, and when i couldn't find a way to do something, the forum came up with solutions.

    The site has been live for over 3 months, and none of the content has gotten messed up..(thanks to PW fields, and limited use of WYSIWYG..!)

    Which is very refreshing, after coming from the world of mostly Joomla, where all of my clients seem to go especially wild with fonts, bold, italic, spacing, font size, (and makes it look AWFUL!) and then i have to periodically go in and do spring cleaning for spans...

    Also - I haven't had to provide any training, tutorials, or support for this site since the site went live, which also illustrates how easy, and user-proof PW is.

    As far as why no women composers...ha... that's an interesting question, and i'll have to ask Howard about that next time i speak with him..

    but it is a statistical reality in contemporary music that men outnumber women...

    and I once heard a conjecture from my freshman music history professor, who said that males are more driven to compose because they can't biologically propagate the species...

    • Like 1
  19. Thanks all for checking it out and the likes.

    this site is using formbuilder, as well as solutions from these forum threads:

    though currently the homepage pop up is disabled...

    the forum has been an essential resource!

    -marc

×
×
  • Create New...