Jump to content

Entil`zha

Members
  • Posts

    29
  • Joined

  • Last visited

Posts posted by Entil`zha

  1. Hi,

    And thx for a quick reply.

    I've manage to accomplish what I wanted with following code:

    <?php namespace ProcessWire;
    
    if( $pagegrid->isBackend() ) { 
    // render things only for the backend
        $content = "";
        $content .= $pagegrid->styles($page);
    } else {
    	// render things only for the frontend
    	$content = "";
    }
    
    $content .= "Example content";
    
    if( $pagegrid->isBackend() ) { 
        // render things only for the backend
        $content .= $pagegrid->scripts($page);
        echo $content;
        die;
    }

    Thank @jploch for pointing me to right direction :)

    • Like 1
  2. Hi,

    First of all, great work @jploch!

    I'm testing pagegrid to integrate it to site with custom theme. By custom theme I mean that the site's appearance is already built manually. So I would like to use PAGEGRID to give users an easy way to handle content in the page.

    I've now installed PAGEGRID and configured it. But the problem is that when I edit the page with PAGEGRID it also load the manually built appearance. The page is built using append and prepend files.

    Any ideas how to do this correctly?

    • Like 1
  3. Hi,

    I've now tried couple times to do fresh installation and I'm having problems to get RockPageBuilder working. I'm using PHP 8.1 and running test enviroment in Ubuntu 22 under WSL. I'm using .local website address.

    I've tried to follow the instructions from https://www.baumrock.com/en/processwire/modules/rockpagebuilder/docs/setup/ but after the installations, rockpagebuilder profile install and uikit download I got following:

    image.thumb.png.5736c365af7c2ced63b9d7a3d42b98c1.png

    This wouldn't be a problem but when click the +-button it doesn't open modal, instead it open admin page:

    image.thumb.png.deda4d1645864377fb8e25f784a50f02.png

     

    So it's pretty hard to use. Also I noticed that after installing profile rockpagebuilder it didn't replace home.php and basic-page.php so I added manually <?= $rockpagebuilder->render(true) ?>. But what differences from the instructions I didn't have to add those required fields to template because they were already in there.

    Any ideas how to get modal working?

  4. Hi,

    For some reason when I try to read and clear messages or errors in template I'll get the messages but they won't clear and will show after next page load.

    I following code in my head.inc which is included in every template.

    $messages = $wire->messages('clear all');
    foreach ($messages as $m) {
    echo '<div class="alert alert-success alert-dismissible" role="alert">';
      echo '<p class="badge badge-pill badge-success">OK</p> ' . $m->text;
      echo '<button type="button" class="close" data-dismiss="alert" aria-label="Close">';
      echo '<span aria-hidden="true">&times;</span>';
      echo '</button>';
      echo '</div>';
    }

    I'll get all the messages but they don't get cleared.

    Only way to clear messages is to load page from admin area.

     

  5. Hi,

    A bit delayed answer and maybe you have already solved this but for others.

    There's always Azure AD behind Office 365 tenant and if you have global administrator privilege you can log in to https://portal.azure.com.

    I'm only tested integration to Azure with custom PHP code but I don't remember did I have to create app or did I manage to use MS REST API without that. I was just playing around Exchange Online then.

  6. Hi,

    Could someone help me InputfieldPage. I'm creating a custom admin module and I want to create form that has one Page reference field. I've managed to create the field but when loading the page it gives me error that this field hasn't been configured. Basically it's a ghost field that doesn't exist but I also tested to create and configure field with same name but no help.

    So if someone could help me how to specify necessary information for field and also how to show selected pages.

    Here's code:

    		$form = $this->modules->get('InputfieldForm');
    		$form->action = "{$this->page->url}savegroup?id={$g->id}";
    		$form->method = "post";
    		
    		$field = $this->modules->get("InputfieldText");
    		$field->name = "groupname";
    		$field->label = __("Ryhmän nimi");
    		if ($g->groupname) {
    			$field->value = $g->groupname;
    		}
    		$form->add($field);
    		
    		$field = $this->modules->get("InputfieldPage");
    		$field->name = "members";
    		$field->label = __("Members");		
    		$form->add($field);

     

  7. 15 minutes ago, HMCB said:

    Wonder what the state of this premium module is. I think everything listed in the Premium modules page for PW should give a sense of trust. There's not activity in this forum and the last changelog goes back to January of last 2016.

    Hi HMCB,

    Lates pre-release is from 4/2017. i think this thread is quit because all the talking regarding to this module is done inside module support group where you can get access after purchasing the module. Ofc apeisa could put some updates here also for advertising purposes. :)

    As for my own experience the module works fine, we have use it for our shop and it offers everything we need.

    • Like 1
  8. 11 hours ago, kongondo said:

    Excellent, thanks! Does Pro method mean it will run automatically (i.e. not lazy and does not require, for example, a 'web visitor')? 

    Actually both methods will run automatically, there's already another module for executing cron via webvisitors (Lazycron or something like that).

    So both methods will run automatically depending how task is defined at crontab (etc. /etc/crontab), the lazy option is targeted for users who just need to run some basic tasks and the pro option is targeted for users who want to do more. :)

    I'm gonna write a better instructions but it's still on todo :)

    • Like 5
  9. Hi,

    We made a little help tool for implementing cron to processwire. Basically the module has two options to run module methods under cron:

    • Lazy method: Just add simple config line to configuration field where you specify module, method and time delay
    • Pro method: Just hook to our method and do everything you want

    Getting started should be relative easy, just install module and add line to configuration field (MyModule;MyMethdo;+10 minute). Delay accepts strtotime formats.

    http://modules.processwire.com/modules/pwcron/

    • Like 7
  10. Hi,

    Does anyone know what has happened processwire.fi domain? It's owned by Avoine Oy so apeisa might know?

    It would be create to see it up and running for showcase to finnish customers, and maybe others too. :)

    If there's a hosting problem with that our company can sponsor platform. I can also help develop the site, just let me know.

  11. Hi,

    I've just started to test my dev site with php 5.6. When trying to download new modules via modules manager I got error:

    PHP message: PHP Warning:  file_get_contents(): SSL operation failed with code 1. OpenSSL Error messages:
    error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed in /usr/local/www/wwwroot/mysite/site/modules/ModulesManager/ModulesManager.module on line 736
    PHP message: PHP Warning:  file_get_contents(): Failed to enable crypto in /usr/local/www/wwwroot/mysite/site/modules/ModulesManager/ModulesManager.module on line 736
    PHP message: PHP Warning:  file_get_contents(https://github.com/apeisa/Thumbnails/zipball/master): failed to open stream: operation failed in /usr/local/www/wwwroot/mysite/site/modules/ModulesManager/ModulesManager.module on line 736
    

    So I changed:

    $context = stream_context_create(array('http' => $options));
    

    to

    $context = stream_context_create(array(
    			'http' => $options,
    			"ssl"  => array(
    				"verify_peer"=>false,
    				"verify_peer_name"=>false,
    			),
    			));
    

    and now it works. I didn't have time to see is openssl changed in php 5.6.

  12. I've just tested these with 2.5 and everything is running nice and smooth. :)

    Hey all,

    I've converted the ProcessWire 2.3 rules to Nginx. Hope this will help some people :)

    Greetings,

    Niek

    server {
    	listen 80;
    	listen 443 ssl;
    
    	root /var/www/example.com/public_html;
    	server_name example.com www.example.com;
    	ssl_certificate /etc/pki/tls/certs/example.com.crt;
    	ssl_certificate_key /etc/pki/tls/private/example.com.key;
    
    	client_max_body_size 50m;
    	access_log /var/www/example.com/_logs/access.log;
    	error_log /var/www/example.com/_logs/error.log;
    
    	# -----------------------------------------------------------------------------------------------
    	# Set default directory index files
    	# -----------------------------------------------------------------------------------------------
    
    	index index.php index.html index.htm;
    
    	# -----------------------------------------------------------------------------------------------
    	# Optional: Redirect users to the 'www.' version of the site (uncomment to enable).
    	# For example: http://processwire.com/ would be redirected to http://www.processwire.com/
    	# -----------------------------------------------------------------------------------------------
    
    	if ($host !~* ^www\.) {
    		rewrite ^(.*)$ $scheme://www.$host$1 permanent;
    	}
    
    	# -----------------------------------------------------------------------------------------------
    	# Access Restrictions: Protect ProcessWire system files
    	# -----------------------------------------------------------------------------------------------
    
    	# Block access to ProcessWire system files
    	location ~ \.(inc|info|module|sh|sql)$ {
    		deny all;
    	}
    
    	# Block access to any file or directory that begins with a period
    	location ~ /\. {
    		deny all;
    	}
    
    	# Block access to protected assets directories
    	location ~ ^/(site|site-[^/]+)/assets/(cache|logs|backups|sessions|config|install|tmp)($|/.*$) {
    		deny all;
    	}
    
    	# Block acceess to the /site/install/ directory
    	location ~ ^/(site|site-[^/]+)/install($|/.*$) {
    		deny all;
    	}
    
    	# Block dirs in /site/assets/ dirs that start with a hyphen
    	location ~ ^/(site|site-[^/]+)/assets.*/-.+/.* {
    		deny all;
    	}
    
    	# Block access to /wire/config.php, /site/config.php, /site/config-dev.php, and /wire/index.config.php
    	location ~ ^/(wire|site|site-[^/]+)/(config|index\.config|config-dev)\.php$ {
    		deny all;
    	}
    
    	# Block access to any PHP-based files in /templates-admin/
    	location ~ ^/(wire|site|site-[^/]+)/templates-admin($|/|/.*\.(php|html?|tpl|inc))$ {
    		deny all;
    	}
    
    	# Block access to any PHP or markup files in /site/templates/
    	location ~ ^/(site|site-[^/]+)/templates($|/|/.*\.(php|html?|tpl|inc))$ {
    		deny all;
    	}
    
    	# Block access to any PHP files in /site/assets/
    	location ~ ^/(site|site-[^/]+)/assets($|/|/.*\.php)$ {
    		deny all;
    	}
    
    	# Block access to any PHP files in core or core module directories
    	location ~ ^/wire/(core|modules)/.*\.(php|inc|tpl|module)$ {
    		deny all;
    	}
    
    	# Block access to any PHP files in /site/modules/
    	location ~ ^/(site|site-[^/]+)/modules/.*\.(php|inc|tpl|module)$ {
    		deny all;
    	}
    
    	# Block access to any software identifying txt files
    	location ~ ^/(COPYRIGHT|INSTALL|README|htaccess)\.(txt|md)$ {
    		deny all;
    	}
    
    	# Block all http access to the default/uninstalled site-default directory
    	location ~ ^/site-default/ {
    		deny all;
    	}
    
    	# -----------------------------------------------------------------------------------------------
    	# If the request is for a static file, then set expires header and disable logging.
    	# Give control to ProcessWire if the requested file or directory is non-existing.
    	# -----------------------------------------------------------------------------------------------
    
    	location ~* \.(js|css|png|jpg|jpeg|gif|ico|svg|eot|woff|ttf)$ {
    		expires 24h;
    		log_not_found off;
    		access_log off;
    		try_files $uri $uri/ /index.php?it=$uri&$args;
    	}
    
    	# -----------------------------------------------------------------------------------------------
    	# This location processes all other requests. If the request is for a file or directory that
    	# physically exists on the server, then load the file. Else give control to ProcessWire.
    	# -----------------------------------------------------------------------------------------------
    
    	location / {
    		try_files $uri $uri/ /index.php?it=$uri&$args;
    	}
    
    	# -----------------------------------------------------------------------------------------------
    	# Pass .php requests to fastcgi socket
    	# -----------------------------------------------------------------------------------------------
    
    	location ~ \.php$ {
    
    		# Check if the requested PHP file actually exists for security
    		try_files $uri =404;
    
    		# Fix for server variables that behave differently under nginx/php-fpm than typically expected
    		fastcgi_split_path_info ^(.+\.php)(/.+)$;
    
    		# Set environment variables
    		include fastcgi_params;
    		fastcgi_param PATH_INFO $fastcgi_path_info;
    		fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
    
    		# Pass request to php-fpm fastcgi socket
    		fastcgi_pass unix:/var/run/example.com_fpm.sock;
    	}
    }
    
    • Like 2
  13. Interesting but I don't see anything in there to actually carry out add/delete of PW pages. How's that supposed to work?

    Hi Steve,

    I'm currently working that part so at this point it's not working yet but probably after this weekend I'll add functionally to add/delete pages.

  14. Hi,

    I've started to build module for managing pages like mindmap style. The idea come from project that had lots of static pages and after the first 50 I was frustrated :).

    At this point module is on pre-pre-pre-alpha state but because it's my first admin module I though it would be wise to let you all see the progress so you can correct me if I'm starting to going the wrong way.

    Features in todo:

    • Mindmap style presentation of pages
    • Ajax driven page adding so that maps is synced with pages
    • Somekind of toolbar for changing page properties trough ajax, what it holds inside I don't know yet :)
    • Any recommendations you give me :)

    EDIT: thx kongondo -> link https://github.com/jkolkka/PagesMapManager

    • Like 1
×
×
  • Create New...