Jump to content

rafaoski

Members
  • Content Count

    70
  • Joined

  • Last visited

  • Days Won

    2

rafaoski last won the day on March 9 2018

rafaoski had the most liked content!

Community Reputation

123 Excellent

About rafaoski

  • Rank
    Full Member

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Thanks ... I am also of the opinion that it is great to have a good basis for further development of the profile that contains the latest additions API ... I think that this profile should be quite simple for users, given that all the latest features are described on the blog ... Anyway, it's nice that it comes in handy ...
  2. This profile can be used as a simple business card or it can be used as a starting profile. Live Example Can download from this link: https://github.com/rafaoski/site-minimal Basic Info Most of the profile settings and translates are in the _init.php file. Functions can be found in the _func.php file. The entire view is rendered in the _main.php file that uses markup regions. You can easily add hooks using the ready.php file. Options page added with the new “Unique” status, which you can use in this simple way like: pages('options')->site_name pages->get('options')->site_name f you want to use Laravel Mix you must first ensure that Node.js and NPM are installed on your machine. Basic example to Debian and Ubuntu based Linux distributions: Node.js curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs See more installation options LINK npm is installed with Node.js just check in linux terminal like below: node -v npm -v Set BrowserSync inside folder /templates/webpack.mix.js and change your dev url proxy: 'http://minimal.test', to your installation processwire folder like: proxy: 'http://localhost/your-processwire-installation-folder/', Next install npm packages in your templates folder with command npm install Now, boot up the dev server npm run watch, and you're all set go! On completion, use the command npm run production to build styles and scripts in the dist folder Simple Usage ( Basic Command ) Run npm install Watch npm run watch Build npm run production All files to Webpack build steps is inside file ( webpack.mix.js ) Folder With all SCSS files is inside templates/asets/src/scss All build styles and scripts is inside the templates/assets -- /css/mix.css -- /js/app.js
  3. Thanks for the answer ... It seems that the LastPass plugin generate error ... After turning off the add-on LastPass everything has returned to normal ...
  4. Hi, @tpr and thanks you for adding this useful module. After switching on AdminOnSteroids I noticed a small problem appearing when opening and closing the repeater, but only in Mozilla Firefox and Admi Theme Uikit. After opening the single repeater, it remains in the open position. I'm not fluent in JS and I do not know where the error is, but the console shows me information as below. Error: Permission denied to access property "apply" SERVER DETAILS ProcessWire: 3.0.126 PHP: 7.3.1 Webserver: Apache/2.4.35 (Win64) OpenSSL/1.1.1a MySQL: 5.7.24 MODULE DETAILS AdminOnSteroids: 2.0.13 ProcessTracyAdminer: 1.0.6 TracyDebugger: 4.17.22
  5. I think it is best to add a photo to the head element as below: ( I've added a simple if statement that will check in which template to display the pictures ) <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?php echo $page->title; ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <link href='//fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> <?php // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; // Show only in these templates $check_templates = ['home', 'basic-page']; if ( in_array($page->template->name, $check_templates) ): ?> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } </style> <?php endif; ?> </head> <body> <main id='main'> Remember to download images correctly if you use the images field, for example: https://processwire.com/docs/fields/images/ <?php $image = $page->images; if($image) echo $image->first()->url; ?> You can also check the selected page where you want to display the picture: <!DOCTYPE html> <html lang="en"> <head> <meta http-equiv="content-type" content="text/html; charset=utf-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <title><?php echo $page->title; ?></title> <meta name="description" content="<?php echo $page->summary; ?>" /> <link href='//fonts.googleapis.com/css?family=Lusitana:400,700|Quattrocento:400,700' rel='stylesheet' type='text/css' /> <link rel="stylesheet" type="text/css" href="<?php echo $config->urls->templates?>styles/main.css" /> <?php // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; // Show only in these pages $check_page_name = ['home', 'about']; if ( in_array($page->name, $check_page_name) ): ?> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } </style> <?php endif; ?> </head> <body> <main id='main'> If you use a REGULAR profile wchich using new template file strategy, it's very simple to add styles in the selected template like home <?php namespace ProcessWire; /* home.php */ // get most recent blog post $blog = pages()->get('/blog/'); $blogPost = $blog->child(); // Get Images ( https://processwire.com/docs/fields/images/ ) $image = $page->images; ?> <head id='html-head' pw-append> <style> /* https://css-tricks.com/perfect-full-page-background-image/ */ body { /* background: url(<?php // if($image) echo $image->first()->url;?>) no-repeat center center fixed; */ background: linear-gradient( rgba(0, 0, 0, 0.91), rgba(2, 35, 50, 0.82) ), url("<?php if($image) echo $image->first()->url;?>") no-repeat center center fixed; background-size: cover; height: 100%; } p, h1, h2, h3 { color: aliceblue; } a { color: tomato; } .summary { color: aliceblue; } .uk-card h3 { color: black; } .uk-card p { color: black; } </style> </head> <h1 id='content-head'> <?=page()->headline?> </h1> <div class='uk-margin-top' id='content-body'> <?=page()->body?> <hr> <p class='uk-margin-small'> <a class='uk-button uk-button-link uk-link-muted' href='<?=$blog->url?>'> In the blog </a> </p> <?=ukBlogPost($blogPost)?> <p class='uk-margin-small'> <a href='<?=$blog->url?>'>More blog posts <?=ukIcon('arrow-right')?></a> </p> </div> <aside id='sidebar'> <?=ukNav(pages()->get('/categories/')->children)?> <div class='uk-card uk-card-default uk-card-hover uk-card-body uk-margin-medium-top'> <?=page()->sidebar?> </div> </aside>
  6. Maybe try using two foreach loops: <?php foreach ($pages->get('/portal/movies/')->children as $movieCategory) { echo "<h3><a href='$movieCategory->url'>$movieCategory->title</a></h3>"; echo '<ul>'; // Get movie Children foreach ($movieCategory->children as $movie ) { echo "<li><a href='$movie->url'> $movie->title </a></li>"; } echo '<ul>'; } ?> Or using $pages->find() ... Show children from the template, which is assigned to a single movie: <ul><?php // https://processwire.com/api/ref/pages/find/ $items = $pages->find("template=single-movie, limit=12"); // Loop foreach ($items as $item) { echo "<li><a href='$item->url'>$item->title</a></li>"; } ?></ul> <?php // Pagination https://processwire.com/api/modules/markup-pager-nav/ $pagination = $items->renderPager(); echo $pagination;?>
  7. You can try this Site Profile Milligram Photoswipe which I've added a simple photoswipe gallery ...
  8. If you want the customer to easily update the fields you can create a translate and translate_string templates. You will be able to easily create translations using pages ... Next, create function inside the _translate file to show translateable field title as in the movie, for example: <?php namespace ProcessWire; function trStr($page, $str) { $tr_page = pages()->get("/translate/$page/")->title; if($tr_page) { return $tr_page; } else { return $str; } } // Translate Strings page()->ts = [ 'your_awesome_string' => trStr('your-awesome-string', __('Your Awesome Strings')), ]; And display on the site: <h1><?=page()->ts['your_awesome_string']?></h1> You can download this profile from here:
  9. Hi ... Here you should find a lot about the translations https://processwire.com/api/multi-language-support/code-i18n/ I do not know if this is the best solution, but it works for me ... Thanks to this, I do not have to search for translations in all of the template's peaks ... So I create a simple file responsible for all translations _translate.php Include this file inside _init.php include_once('./_func.php'); include_once('./_translate.php'); And define in the table as below <?php namespace ProcessWire; // Translate Strings page()->ts = [ // Language => locale / code prefx 'locale' => _x('en_US', 'HTML locale code'), 'lang_code' => _x('en', 'HTML language code'), // Main Page ( main.php ) 'site_name' => __('Your Site Name'), 'logo_alt' => __('Show My Awesome Logo'), // Archives Page 's_archives' => __('Select The Archives'), 'date' => __('Date'), ]; Then you can call globally using page() <h1><?=page()->ts['site_name'];?></h1> And there is a pro option Functional Fields: https://processwire.com/blog/posts/functional-fields/ But I can not say too much about it because I have not tested it but it looks interesting
  10. Hi and welcome ... You can add your own field in a very simple way ... See also here https://processwire.com/api/variables/page/ You have to go to the template that the page uses and add a few lines of php code as below ... <?php echo page()->custom_field?> <?php echo $page->custom_field?> <?php echo page('custom_field')?> See this short video in which I used the regular UIKIT 3 profile which is in the Processwire DEV version You can display this field in the _main.php file in the same way, or if for example, you create an option page, you can use this way in which the field will be visible on all pages https://processwire.com/api/variables/pages/ ... <h1>Home Page Field ( / ) <?= pages('/')->custom_field ?></h1> <h1>Home Page Field ( / ) <?= pages()->get('/')->custom_field ?></h1> <h1>About Page Field ( /about/ ) <?= pages('/about/')->headline ?></h1> <h1>About Page Field ( /about/ ) <?= pages()->get('/about/')->headline ?></h1> This old tutorial is also good to starting learn Processwire : https://processwire.com/docs/tutorials/hello-worlds/
  11. Thanks to Adrian, everything has become clear now
  12. Hi everyone ... Generally, this is about the new mailHTML() function that does not work correctly on processwire 3.0.110 https://github.com/processwire/processwire/blob/dev/wire/core/WireMailTools.php#L291 https://processwire.com/api/ref/mail/mail-h-t-m-l/ I do not know if I'm making a mistake trying to send an e-mail or if it's a bug in the core This is my code: <?php // $m = $mail->new(); // option A // $m = new WireMail(); // option B $m = wireMail(); // option C $m->mailHTML('alex@gmail.com', 'Hello', '<html><body><h1>Message Body</h1></body></html>'); $m->send(); ?> Details from Tracy Debugger SERVER DETAILS ProcessWire: 3.0.110 PHP: 7.2.8 Webserver: Apache/2.4.34 (Unix) MySQL: 10.1.34-MariaDB SERVER SETTINGS allow_url_fopen: 1 max_execution_time: 120 (changeable) max_input_nesting_level: 64 max_input_time: 60 max_input_vars: 1000 memory_limit: 256M post_max_size: 8M upload_max_filesize: 20M xdebug: xdebug.max_nesting_level: mod_rewrite: 1 mod_security: *confirmed off GD: 2.2.5 GIF: 1 JPG: 1 PNG: 1 EXIF Support: FreeType: 1 Imagick Extension: MODULE DETAILS TracyDebugger: 4.11.13
  13. Thanks to @dragan ... It looks like it's okay now after adding the margin auto to the grid /* eliminate horizontal scrollbars */ .grid { margin-right: auto; margin-left: auto; }
  14. Thanks to @Pixrael ... I have already added this profile, but as usual, it will take some time before the profile is approved I think that in a few hours the profile should be in the module catalog
  15. This profile can be used as a business card or very simple blog. Requires the latest version processwire 3.0.101 !!! Milligram Site Profile For Processwire 3x with include functions like: MarkupRegions FunctionsAPI wireIncludeFile | wireRenderFile Essentially, this structure uses minimalist CSS framework Milligram and the Flexbox Grid System Gridlex Live Example CAN DOWNLOAD FROM THIS LINK ( Basic Version and simple Blog Version ) https://github.com/rafaoski/site-milligram https://github.com/rafaoski/site-milligram-blog Screenshot: If you want to use Laravel Mix you must first ensure that Node.js and NPM are installed on your machine. Basic example to Debian and Ubuntu based Linux distributions: Node.js curl -sL https://deb.nodesource.com/setup_8.x | sudo -E bash - sudo apt-get install -y nodejs See more installation options LINK npm is installed with Node.js just check in linux terminal like below: node -v npm -v Set BrowserSync inside folder /templates/webpack.mix.js and change your dev url proxy: 'http://localhost/mix/', to your installation processwire folder like: proxy: 'http://localhost/your-processwire-installation-folder/', Next install npm packages in your templates folder with command npm install Now, boot up the dev server npm run watch, and you're all set go! On completion, use the command npm run production to build styles and scripts in the dist folder Simple Usage ( Basic Command ) Run npm install Watch npm run watch Build npm run production All files to Webpack build steps is inside file ( webpack.mix.js ) Folder With all SCSS files is inside templates/src/scss All build styles and scripts is inside the ( dist ) folder References: Milligram Gridlex Laravel Mix Feather Icons Web Font Loader Verlok Lazy Load Cookie Consent Particles.js
×
×
  • Create New...