Jump to content

dab

Members
  • Posts

    152
  • Joined

  • Last visited

Posts posted by dab

  1. @jor

    Not sure if this is the correct way, but on my map template I wrap my code with:

    if($page->marker->address) {

    }

    e.g.

    if($page->marker->address) {
    
    	$map = wire('modules')->get('MarkupLeafletMap'); 
    	$options = array(
    
        'markerFormatter' => function($page, $marker_options) {
            			if ($page->marker_icon->title) {
                            $marker_options['icon'] = $page->marker_icon->title;
                        }
    
                        if ($page->marker_colour->title) {
                            $marker_options['markerColor'] = $page->marker_colour->title;
                        }
    
                        // And the icon colour. This is another text field. Colour values like White, Black or an RGB value are ok here.
                        if ($page->marker_icon_colour->title) {
                            $marker_options['iconColor'] = $page->marker_icon_colour->title;
                        }    
            return $marker_options;
        },
    
        'popupFormatter' => function($page) {
            $out[] = "<strong>$page->headline</strong>";
            return implode('<br/>', $out);
        }
    
    );
           
    
    $content.= $map->render($page, 'marker', $options);
    
    }

    If no address is entered, no map is shown.

  2. Have a look at delayed output strategy. You have one main "template"(_main.php) & can then simply create a new template for a sub-section page where you just add code for regions/sections of your _main template where you want to show different content (summaries, other content etc.).

    I found the intermediate templates a good starting point to see how _main.php & e.g. home.php or basic.php interact.

    Once you've learnt this, look at markup regions - super powerful (once mastered)!

  3. @adrianThanks for the speedy reply. Most odd, WHM/Cpanel was reporting PHP 7.2, but I double checked with a "phpinfo" file & it showed PHP5.6! I reset the PHP version to PHP 7.2.32 & it's cleared the error.

    Apologies for the incorrect info & thanks for the fix for <7 (& for such a great module)!  

    • Like 1
  4. Has anyone come across this error?

    Parse error: syntax error, unexpected ':', expecting ';' or '{' in /home/********/public_html/site/assets/cache/FileCompiler/site/modules/TracyDebugger/includes/PwApiData.php on line 516

    PW 3.0.148, Tracy Debugger 4.21.20, PHP 7.2.

    line 516 is 

    private function phpdoc_params(ReflectionMethod $method) : array {

    Have tried a reinstall & cleared complied  files from > Modules. No errors on other sites on same server with same setup. 

  5. I noted that you can't add an unpublished page to the list of pages a user can edit.

    It results in error: "Unpublished page /en/members/test/ is not allowed in field "Pages user may edit". To allow unpublished pages, edit the “editable_pages” field and see the setting on the “Details” tab."

    I'm not sure where to find this - or if it is applicable as Page Edit Per User is a hook in to the system.

     

    • Like 1
  6. @ryan I love this module, makes it super easy to allow users access to edit their own pages, thank you!

    I can't find a way to allow users to publish/unpublish their pages....

    I added these lines to the module

    public function init() {
    		$this->addHookAfter('Page::publishable', $this, 'hookPageEditable'); 		
    	}
    
    	/**
    	 * Page::publishable hook
    	 *
    	 */
    	public function hookPagePublishable($event) {
    		if($event->return) return;
    		$event->return = $this->onMyBranch($event->object);
    	}

    & bingo, an "unpublish" button appears & a user can unpublish thier page. However, if they do, they lose access to it (it disappears from the page tree) & only a superuser (site admin) and republish it.

    Please can you help with this - page publish/unpublish would make this module just perfect!   

    Many thanks ?

  7. Thanks, very good to hear of other's experiences. I looked at Snipcart, but was put off by the fees (2%/ transactions + gateway fees) just made it too expensive. Yes, back end of foxy is ugly & I needed some help with some aspects of the coding, but have found it usable for simple ecommerce projects.

    • Like 1
  8. I've used Padloper for two Processwire sites, but not found it suitable for other projects due to only working with Paypal & Stripe payment gateways; neither being the client's gateway of choice.

    More recently I've used Foxycart; now on 4 ecommerce sites. I've really enjoyed the challenge integrating it into my sites with the help of some amazing Processwire forum members here ? (XML & JSON datafeeds).

    It's compatible with over 100 payment gateways & the datafeeds can be used for updating stock levels, recording orders on to your Processwire site. I think it's worth a look if your project needs  to use a specific payment gateway. 

     

      

    • Thanks 1
  9. Snipcart looks nice (though I've not tried it). I looked at it & the 2% of transactions fees on top of payment gateway fees put me off, plus only a few payment gateways are supported.

    I've used Foxy.io (Foxy Cart) with ProcessWire on a site & it works really well*. Fees are low (approx £16/month) & loads of payment gateways are supported.

    I'm happy so post/share code if anyone needs it.

    *Big thanks go to both @netcarver an @Macrura for helping me with some of the datafeed integrations back to ProcessWire.

    • Like 2
  10. I'm having problems adding a second category to check for emails & save to pages no PW errors (or php errors).

    On "save" no new Email Category is added.

    Anyone else encountering difficulties? I'm using ProcessEmailToPage v. 1.3.3, PW 3.0.123 & php PHP 7.2.

    Thanks Nick

  11. I used this to get the access token:

    https://api.instagram.com/oauth/authorize/?client_id=CLIENT-ID&redirect_uri=https://www.yourdomainhere.co.uk/processwire/module/edit?name=InstagramFeed&response_type=code

    1. Replace CLIENT-ID with your own CLIENT-ID code
    2. I removed the trailing slash off suggested code on Processwire Module instructions

    http://page.dev/processwire/module/edit?name=InstagramFeed/

    Works OK for me, but I am getting error code "[InstagramFeed]: No user" too, but otherwise feed working OK.

  12. On 1/16/2019 at 1:45 PM, Jan P. said:

    Hello,

    we found the following solution that is quite similar to the suggestion from Autofahrn. Our setup includes two languages
    - de (german) as default for *.de domain (default language)
    - en (english) for *.com domain


    In _init.php there is just:

    
    if (preg_match("/(:2284|\.com)/", $config->httpHost)) {
        $user->language = $languages->get('englisch');
    }


    Your question no. 2: It is important that you configure the settings for your root page to "/" for each language. In that case PW doesn't prefix your URL paths for the children.

    Be careful! In case you use the front page editor - when a child page has the same path for every language, the front page editor is not able to save the page correctly. You have to use the backend. But if there are differences, for example *.com/imprint and *.de/impressum - the front page editor works fine.


     

    This works beautifully, thanks.

    & if any users need help on configuring their DNS (to point 2 domains to a single install of PW) on WHM use the >cPanel > Domains > Aliases function to add your extra domains (after enabling on > Server Configuration > Tweak Settings > Domains > "Allow users to park subdomains of the server’s hostname".

×
×
  • Create New...