Jump to content

Gayan Virajith

Members
  • Posts

    58
  • Joined

  • Last visited

Everything posted by Gayan Virajith

  1. Hello, Welcome to the forum... Thanks to Purwa and Arjen you could see this https://processwire.com/talk/topic/7945-question-about-multi-language/ In simply you can try like follows: placeholder="<?php echo __('Your placeholder') ?>"> Thanks
  2. Thanks Sinmok and netcarver. It would be really useful when we are using a front-end framework like Bootstrap. <?php $list = $pages->find("template=basic-page"); // Returns 5 pages $chunked = array_chunk($list->getArray(), 3); ?> <?php foreach($chunked as $i => $row): ?> <div class='row'> <?php foreach($row as $item) : ?> <div class="col-md-4"> <?php echo $item->title; ?> </div> <?php endforeach; ?> </div> <?php endforeach; ?>
  3. Hi Bueno, Try this foreach($languages as $language) { if(wire('user')->language->id == $language->id) continue; // skip current language if(!$page->viewable($language)) continue; // check if page not published for this language $url = wire('page')->localUrl($language); $title = $language->getUnformatted('title')->getLanguagevalue($language->id); $name = $language->get('language_name'); $location = $config->urls->templates; echo "<li>$title</a></li>"; }
  4. I am working on Fedora 20. May be this would help you. <VirtualHost *:80> DocumentRoot "/home/user-2/dev/php/ProcessWire/pwire-2" ServerName pwire-2.localhost # This should be omitted in the production environment SetEnv APPLICATION_ENV development <Directory "/home/user-2/dev/php/ProcessWire/pwire-2"> Options Indexes MultiViews FollowSymLinks AllowOverride All Order allow,deny Allow from all # New directive needed in Apache 2.4.3: Require all granted </Directory> </VirtualHost> Thanks ------------------------------------------------------------------------ Edit: Add a comment for the new directive used for Apache 2.4.3 under <Directory> tag
  5. Please double check HTTP Hosts Whitelist settings under site/config.php. /** * Installer: HTTP Hosts Whitelist * */ $config->httpHosts = array('example.com', 'www.example.com'); Thanks
  6. How about trying `include=all`. $staff = $pages->find("/about-us/meet-the-team/, include=all")->children;
  7. http://compressor.io/ by Stephane Lyver Found nice online tool to compress images.
  8. Hi All, I am gladly posting my first site profile. Blue-VR Site Profile for ProcessWire Summary A site profile for corporate or personal website. Profile can be used with ProcessWire open source CMS/CMF version 2.3+. The front-end uses the Bootstrap 3.1 css framework for to get the responsiveness and mobile friendliness. Front-end Demo - bluevr.webcreate.lk Back-end Demo mode - bluevr-webcreate.lk/processwire (The username 'admin' and password 'bluevr2') Overall features * HTML5 & CSS3 + ({less}) * Build with bootstrap 3.1 * SEO Friendly * Clean & modern design * Responsive markup * Contact form and google map locations with multiple google markers * Testimonials using bxSlider * AIOM supports (Just install the module no need to touch the code) How to install Please take a copy of the latest ProcessWire (Replace the install, modules and templates directories with those in this profile, as shown below: - /site-default/install/ - /site-default/modules/ - /site-default/templates/ Make sure you do following steps as well 1. Add `tinymce` directory into /site-defaut. 2. Add the following two lines to your `/site/config.php` file: $config->prependTemplateFile = '_init.php'; $config->appendTemplateFile = '_main.php'; Download Github: https://github.com/gayanvirajith/BlueVrSiteProfile/ Credits I would like to thanks Ryan for giving us great CMS/CMF and modules. Hani AbuGhazaleh for a great module of Fieldtype: Select (AKA Drop Down) David Karich for providing such a nice module AIOM+. *** Please note that the site profile is still on testing stage. Thanks ------------------------------------------------------------------------ Edit: install instructions. Edit: Add credits Edit: Update live demo url Edit: Update back-end demo mode details
  9. Hi Melissa, I tried to reproduce this scenario on my local setup. It works for me. Here what I have done. Here is my templates structure └── news - Has templates/news.php file. Enable Allow Page Numbers (Templates > news > URLs Tab > Checked Allow Page Numbers?) └── month - (Template > month Family Tab > Allowed templates for parents(s) - news, Allowed template(s) for children - news_story) └── news_story (Template > news_story Family Tab > Allowed templates for parents(s) - month Here is my page structure └── News (uses news template) └── 2014 (uses year template) ├── Feb (uses month template) │ ├── Story-4 (uses news_story template) │ └── Story-5 (uses news_story template) └── Jan ├── Story-1 (uses news_story template) ├── Story-2 (uses news_story template) └── Story-3 (uses news_story template) I added fetching+pagination code in templates/news.php <?php if(!$page->template->allowPageNum) { // notify me to enable pagination in the template echo "<p class='alert label'>" . "This template needs page numbers enabled to support pagination!<br />" . "Go to: Admin - Setup - Templates - Edit: '$page->template' - URLs " . "</p>"; exit; } $results = $page->find("template=news_story, limit=3"); $pagination = $results->renderPager(); ?> <?php foreach ($results as $child): ?> <?php echo "<h4><a href='{$child->url}'>{$child->title}</a></h4>";?> <?php endforeach; ?> <div class="pagination"><?php echo $pagination;?></div> Hope this would help a little. Thanks Edit: Fixed some typo
  10. Hi Mike, Such a wonderful work. Keep it up... Thanks
  11. I also forget to edit config.php after install on different server. Thanks to Ryan I am using following code block to overcome this issue. Please add this on top of your template file (templates/home.php). In this way you want be having a blank page, it will remind you to edit the config.php /* * Check that required settings are in place. * Feel free to remove this if your site already works. * */ if($config->prependTemplateFile != '_init.php' || $config->appendTemplateFile != '_main.php') { echo ' <h2>Please edit your /site/config.php and set:</h2> <pre> $config->prependTemplateFile = "_init.php"; $config->appendTemplateFile = "_main.php"; </pre> '; exit; } You can also find these on Ryan's FoundationSiteProfile (Please check templates/home.php) Thanks
  12. Hi, May be my little thought would help... In repeater_sd_note.php - Please try to change with following statements: echo "<p><strong>Type:</strong> $page->sd_type->title</p>"; echo "<p><strong>Status:</strong> $page->sd_status->title</p>"; echo "<p><strong>Priority:</strong> $page->sd_priority->title</p>"; Thanks
  13. Hi, This might be helpful to you. <?php foreach($page->home_bullets as $bullet): ?> <div class="col group"> <?php // get the very first image from images list since image field is accepting multiple images (unless you change the value of `Maximum files allowed` under Fields > images > Details tab > Maximum files allowed). $image = $bullet->images->first(); ?> <div class="col first"><img src="<?php echo $image->url; ?>" alt="<?php echo $image->description; ?>"></div> <div class="col second"><span><?=$bullet->body ?></span></div> </div> <?php endforeach; ?> Thanks
  14. Hi Soma, Thank you for your advise. I will look into LanguageSupportPageNames. Thanks again ProcessWire community.
  15. @Martijn - thanks for quick response. mbstring is already been installed php-mbstring.i686 (5.4.15-1.fc18) <?php echo mb_internal_encoding(); ?> will output `UTF-8`; Thanks again Martijn.
  16. Hi community, I am trying to create small module with one configurable input field. I would like to know whether configurable input field supports multi-language feature. I tried following way but no luck. public static function getModuleConfigInputfields(array $data) { $inputfields = new InputfieldWrapper(); // ask static banner content $field = wire('modules')->get('InputfieldTinyMCE'); $field->set('type', wire('modules')->get('FieldtypeTextLanguage')); $field->name = 'bannerBody'; $field->label = "Banner content"; $field->description = ""; if(isset($data['bannerBody'])) $field->value = $data['bannerBody']; $inputfields->add($field); return $inputfields; } Please advise. Thanks ProcessWire & friendly community.
  17. Hi Adrian, Thank you so much. Yes that is it. Here is the working piece : /* Create new field using API */ $field = new Field(); // Set type as FieldtypeTextarea $field->type = $this->modules->get("FieldtypeTextarea"); // Set inputfield as InputfieldTinyMCE. Thanks to Adrian $field->set('inputfieldClass', "InputfieldTinyMCE"); // name of the field $field->name = 'footer_region'; // set label $field->label = 'Footer region area'; // Save ! $field->save(); Thanks again Adrian & the community
  18. Hello community, I am trying to create a field using API. Basically field should have a type of FieldtypeTextarea and InputfieldTinyMCE as inputfield. Here is my code : /* Create new field using API */ $field = new Field(); // Set type as FieldtypeTextarea $field->type = $this->modules->get("FieldtypeTextarea"); // Set inputfield as InputfieldTinyMCE. But no luck $field->set('inputfield', 'InputfieldTinyMCE'); // Name of the field $field->name = 'footer_region'; // Set label $field->label = 'Footer region area'; // Save $field->save(); Above code will create a new field with the type of FieldtypeTextarea. But it want assign InputfieldTinyMCE as the inputfield. Any advise please Thank you
  19. Hi, Welcome to the forum... May be something like this would help you: <?php //Fetch results from restaurant/features where page id mixed $parentPages = wire('pages')->find("parent=/restaurant/features, id=1052|1053|1054|1115, sort=sort"); ?> <ul> <?php foreach($parentPages as $childPage): ?> <li> <a href="<?php echo $childPage->url?>"> <?php echo $childPage->title; ?> </a> </li> <?php endforeach; ?> </ul>
  20. Hey peterfoeng, Nice piece of work. Site is awesome. ~ Happy coding with processwire ~
  21. It would definitely help and even for beginners like me. Thanks kongondo
×
×
  • Create New...