-
Posts
704 -
Joined
-
Last visited
Everything posted by Christophe
-
You can first change the default language (or not), in order to have the French language tabs in first position for example. If you do so: Add the French language pack files there; For the new English (or whatever) language don't add anything. It will use the ("internal") English language by default. In Admin > Access > Users > guest, you can choose the French language, for visitors. In Admin >Modules > Languages Support - Page Names, you have it by default but only for the homepage: Default language homepage URL is same as root URL? In Admin > Setup > Languages > en (or whatever Title you've chosen) > Settings, you can choose: Status: Hidden: Excluded from lists and searches You will only see the French tabs in pages, for example. You won't see the Active? option (and URL row) for the English language anymore. In Pages >Home > Settings, you can just not choose the Active? option for the English language. In Pages >Home > Settings, you can completely remove the /fr/ part of the French URL, if you want to. [ http://modules.processwire.com/modules/french-language-pack/ ]
-
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
Started transforming the code to be able to add a current class to the parent of the current sub(-)child/link: <div class="clearfix"> <div class='topnav'> <nav class="nav-wrap-navbar nav-collapse"> <a class="nav-toggle-navbar" data-nav-toggle="#nav-menu" href="#">Menu</a> <div class="nav-menu-navbar" id="nav-menu"> <ul class="nav-navbar"> <?php if($homepage->id == $page->rootParent->id) { echo "<li class='current'><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } else { echo "<li><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } foreach($homepage->children as $h_child) { $subchildren = $h_child->children; if(count($subchildren)) { if($subchildren->id == $page->id) { $class = 'current '; } else { $class = ''; } echo "<li class='{$class}dropdown-jumbo' data-dropdown><a href='{$subchildren->first()->url}'>{$h_child->title}<span class='dropdown-show'>+</span><span class='dropdown-hide'>-</span></a><div class='dropdown-menu-jumbo' data-dropdown-menu><div class='container'><div class='grid-three-fourths float-center'><ul>"; foreach($h_child->children as $subchildren) { if($subchildren->id == $page->id) { echo "<li class='current'><a href='{$subchildren->url}'>{$subchildren->title}</a></li>"; } else { echo "<li><a href='{$subchildren->url}'>{$subchildren->title}</a></li>"; } } echo "</ul></div></div></div></li>"; } else { if($h_child->id == $page->id) { echo "<li class='current'>"; } else { echo "<li>"; } echo "<a href='{$h_child->url}'>{$h_child->title}</a></li>"; } } ?> </ul> </div> </nav> </div> </div> For the moment no result. The else part works (tested by replacing the empty string with something else). I feel it's normal that it shouldn't work as it is, but I don't know enough to resolve the problem easily (or at all) for the moment. Perhaps it's just an order and/or a "nested" problem. Edit: replacing $page->id with certain other things in the first if($subchildren->id == $page->id) I can have a current class added... but on all parents having children. Perhaps using &&? I've tried again several variations. Is it possible, or not, to have the current class added to the direct parent of a sub-child if the latter is the current one (with a current class itself)? I've looked a bit in the cheatsheet in case but for the moment... I've just tried with if($subchildren->id == $page->id && $subchildren->parent->id == $page->parent->id), but no... Any "idea"/help? -
@Tomas: I didn't know what you already knew or had done, so I posted it in case it helped you or anyone else in the future.
-
Just wanted to precise that logs are now viewable by default (core functionality): Admin > Setup > Logs >
-
Hi, In wire/config.php, you can see: /*** 1. SYSTEM MODES ****************************************************************************/ /** * Enable debug mode? * * Debug mode causes additional info to appear for use during site development and debugging. * This is almost always recommended for sites in development. However, you should * always have this disabled for live/production sites since it reveals more information * than is advisible for security. * * #notes This enables debug mode for ALL requests. See the debugIf option for an alternative. * * @var bool * */ $config->debug = false; /** * Enable debug mode if condition is met * * Set debug mode to be false above, and then specify any one of the following here: * 1) IP address of user required to enable debug mode; * 2) Your own callable function name (i.e. "debug_mode") in /site/config.php that returns * true or false for debug mode; * 3) PCRE regular expression to match IP address of user (must start and end with a "/" * slash). If IP address matches, then debug mode is enabled. Regular expression * example: /^123\.456\.789\./ would match all IP addresses that started with 123.456.789. * * #notes When used, this overrides $config->debug, changing it at runtime automatically. * @var string * */ $config->debugIf = ''; /** * Tools, and their order, to show in debug mode (admin) * * Options include: pages, api, session, modules, hooks, database, db, timers, user, input, cache * * @var array * */ $config->debugTools = array( 'pages', 'api', 'session', 'modules', 'hooks', 'database', // PDO 'db', // mysqli 'timers', 'user', 'input', 'cache', ); /** * Enable ProcessWire advanced development mode? * * Turns on additional options in ProcessWire Admin that aren't applicable in all instances. * Be careful with this as some options configured in advanced mode cannot be removed once * set (at least not without going directly into the database). * * #notes Recommended mode is false, except occasionally during ProcessWire core or module development. * @var bool * */ $config->advanced = false; /** * Enable demo mode? * * If true, disables save functions in Process modules (admin). * */ $config->demo = false; Putting $config->debug = true; in site/config.php enables debug mode. You also have Admin > Setup > Logs > Logs are in site/assets/logs/ (and perhaps elsewhere(?)).
-
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
<div class="clearfix"> <div class='topnav'> <nav class="nav-wrap-navbar nav-collapse"> <a class="nav-toggle-navbar" data-nav-toggle="#nav-menu" href="#">Menu</a> <div class="nav-menu-navbar" id="nav-menu"> <ul class="nav-navbar"> <?php if($homepage->id == $page->rootParent->id) { echo "<li class='current'><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } else { echo "<li><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } foreach($homepage->children as $h_child) { $subchildren = $h_child->children; if(count($subchildren)) { echo "<li class='dropdown-jumbo' data-dropdown><a href='{$subchildren->first()->url}'>{$h_child->title}<span class='dropdown-show'>+</span><span class='dropdown-hide'>-</span></a><div class='dropdown-menu-jumbo' data-dropdown-menu><div class='container'><div class='grid-three-fourths float-center'><ul>"; foreach($h_child->children as $subchildren) { if($subchildren->id == $page->id) { echo "<li class='current'><a href='{$subchildren->url}'>{$subchildren->title}</a></li>"; } else { echo "<li><a href='{$subchildren->url}'>{$subchildren->title}</a></li>"; } } echo "</ul></div></div></div></li>"; } else { if($h_child->id == $page->id) { echo "<li class='current'>"; } else { echo "<li>"; } echo "<a href='{$h_child->url}'>{$h_child->title}</a></li>"; } } ?> </ul> </div> </nav> </div> </div> I will be editing this. I still need help from php experts. Now, only remains to have a current sub(-)child/link (and its direct parent also) in another color thanks to a current class(es). Now, only remains to have the parent of the current sub(-)child/link in another color thanks to a current class. NB: at the end, the code will certainly be duplicating things. It is already... -
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
The main "issue" is fixed. Now I would need to have the code in the header "transformed" in order to have first-level links (whether they have children or not, and including the homepage) in another color when their related page is the current one. And also, for a first-level link that has children, the current sub-link/child would also be in another color. Thank you for some help! -
What about a ProcessWire Day , when we could all celebrate ProcessWire? I know we do it a lot of days already...
-
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
I've decided to restart almost from scratch, and without a function for this time. So, for the moment, there is: this in the head: <link rel="stylesheet" href="<?php echo $config->urls->templates?>dist/css/main.min.css" /> <link rel="stylesheet" href="<?php echo $config->urls->templates?>dist/css/drop-jumbo.min.css" /> <link rel="stylesheet" href="<?php echo $config->urls->templates?>dist/css/astro-navbar.min.css" /> <link rel="stylesheet" href="<?php echo $config->urls->templates?>styles/my-custom-css.css" /> </head> this at the end of the body: <script src="<?php echo $config->urls->templates?>dist/js/drop.min.js"></script> <script src="<?php echo $config->urls->templates?>dist/js/astro.min.js"></script> <script src="<?php echo $config->urls->templates?>dist/js/classList.min.js"></script> <script> drop.init(); astro.init(); </script> <!-- feature detection <script src="dist/js/detects.min.js"></script> --> </body> and this in the header: <div class="clearfix"> <div class='topnav'> <nav class="nav-wrap-navbar nav-collapse"> <a class="nav-toggle-navbar" data-nav-toggle="#nav-menu" href="#">Menu</a> <div class="nav-menu-navbar" id="nav-menu"> <ul class="nav-navbar"> <?php if($homepage) { echo "<li class='current'><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } else { echo "<li><a href='{$config->urls->root}'>{$homepage->title}</a></li>"; } foreach($homepage->children as $page) { $subchildren = $page->children; if(count($subchildren)) { echo "<li class='dropdown-jumbo' data-dropdown><a href='{$subchildren->first()->url}'>{$page->title}<span class='dropdown-show'>+</span><span class='dropdown-hide'>-</span></a><div class='dropdown-menu-jumbo' data-dropdown-menu><div class='container'><div class='grid-three-fourths float-center'><ul>"; foreach($page->children as $subchildren) { echo "<li><a href='{$subchildren->url}'>{$subchildren->title}</a></li>"; } echo "</ul></div></div></div></li>"; } else { if($page->id == $page->rootParent->id) { echo "<li class='current'>"; } else { echo "<li>"; } echo "<a href='{$page->url}'>{$page->title}</a></li>"; } } ?> </ul> </div> </nav> </div> </div> I've tried a lot of variations everywhere. The fact is that I've also tried at the same time to add a class current to the homepage link and the other first level links that don't have children (I'm not sure yet if I should have one also on those with children and what to do with the children as they normally have an active class applied to them with javascript). For the moment I can't manage to have the current class only applied to a first level link that is not the homepage. When one is "current" the homepage is also "current". But my real "issue" currently (what I have to resolve first) is the fact that I've replaced (but not only) something like <div class="grid-half"> Content </div> with <ul><li><a>Text</ul></li></a> in the orginal code, and perhaps because of this when I want to click on a sub-link in the drop-down it doesn't load the page (but the url is fine). So, I'm finally going to have to choose a username (not so easy) and create a GitHub account in order to post to the issues section of the Drop GitHub repository. NB: to choose $homepage->children as $page is perhaps not the best choice in this case (I've tried with something else at some point but it wouldn't work). It could be part of some code I've borrowed, I don't remember exactly. PS: I could provide a link to the online development website to see the link "issue" in action... The problem could come from an active class being applied to a second-level anchor(?). -
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
Hello again, I'd also like to understand what the code is doing . -
Perhaps you'll find your solution here: http://stackoverflow.com/questions/18890053/php-conditions-depending-on-window-width-media-queries I guess there are "solutions" with PHP, PHP + Javascript, Javascript... By the way, a ProcessWire version is missing at "3rd party modules" here: https://github.com/serbanghita/mobile-detect NB: don't forget to also read the last answer(s). Edit: see also https://css-tricks.com/forums/topic/how-to-load-a-section-of-content-only-if-the-screen-is-over-a-certain-width/
-
https://www.own-mailbox.com/ https://www.kickstarter.com/projects/1547898916/own-mailbox-the-first-100-confidential-mailbox
-
- 2
-
-
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
Hello, For the moment, I only have something like the following in place: Homepage Location 1 Location 2 Location 3 Other link(s) Homepage: one single link. Location 1: several pages on different levels, but normally only one sub-level in this menu (with a contact link, among other links). For the other levels there will certainly be another menu on the side. Location 2: one sub-level only also. There will probably be no more than 3 or 4 pages for this location (including a contact page). Location 3: the same as above but normally with only 2 pages (including a contact page). Other link(s): if there are no children/is no sub-link, <span class="dropdown-show">+</span> <span class="dropdown-hide">-</span> and <div class="dropdown-menu-jumbo" data-dropdown-menu> <div class="container"> <div class="grid-three-fourths float-center"> <ul> <li><a href="#">Sub-link</a></li> </ul> </div> </div> </div> should not be rendered. Not sure how much of the (only) html code can not be included in the function. NB: it could take a lot of time before I can receive/get some (good) content for/from each location: images, texts... -
Allow translators to work on "hidden" language
Christophe replied to maba's topic in Multi-Language Support
Hello again, I'm just a beginner with regex. I had found the code via Google. The "$1" part seemed a bit strange to me (in this case). It normally corresponds to the first "capturing group" (that you sometimes/always? put between parenthesis). Perhaps a slash was needed before en or se(?). "- Will also redirect any URL that starts with letters "en" on "se" in the default language, for example "/enigma" or "/second"." This seems normal as .* = .{0,} = match any char zero or more times, and there is no slash after en or se. You normally need a slash before (.*), in your case. You could use (en|se) also apparently or [a-z]{2} (Limits to 2 characters. With or without parenthesis, it depends on the case). You can test regex codes at https://regex101.com/, http://regexr.com/ or elsewhere. There is also, for instance, http://regex.learncodethehardway.org/book/. I don't remember if I finished reading everything. I'll probably have to start all over again (one day). -
ProcessWire would probably really benefit from being listed at https://developers.google.com/webmasters/mobile-sites/website-software/index?hl=en and having its own page like it is already the case for: - WordPress, Joomla!, Drupal, Blogger, vBulletin, Tumblr, DataLife Engine, Magento, Prestashop, Bitrix, Google Sites, Typepad (external site), Squarespace (external site) and Wix (external site). See "How do I make my site mobile friendly?" and "If your website software isn’t listed or you have any feedback, feel free to fill in this form.".
-
Kraken: Drop Jumbo with Astro Navbar. Conversion to ProcessWire
Christophe replied to Christophe's topic in General Support
Thank you. I'll try to understand the logic behind the code. I'm really new to PHP. Edit: I'm working on it, but the navigation structure and logic is different from the examples so I'm having a hard time figuring out how to adapt it... And I'm not sure I really understand what the examples code is doing. -
Hello, I would like to use the Jumbo version of Drop (Simple, mobile-friendly dropdown menus). With the Navbar version of Astro (A collection of five mobile-first navigation patterns, with an optional expand-and-collapse menu on small screens). https://cferdinandi.github.io/kraken/odds-and-ends.html The Drop demo also uses Astro. Here is the static code that I currently have for the project I want it for: <nav class="nav-wrap-navbar nav-collapse"> <a class="nav-toggle-navbar" data-nav-toggle="#nav-menu" href="#">Menu</a> <div class="nav-menu-navbar" id="nav-menu"> <ul class="nav-navbar"> <li class="dropdown-jumbo" data-dropdown> <a href="FALLBACK-URL.com"> Link <span class="dropdown-show">+</span> <span class="dropdown-hide">-</span> </a> <div class="dropdown-menu-jumbo" data-dropdown-menu> <div class="container"> <div class="grid-three-fourths float-center"> <ul> <li><a href="#">Sub-link</a></li> </ul> </div> </div> </div> </li> </ul> </div> </nav> The first href="#" has to stay as it is. href="FALLBACK-URL.com" is here in case javascript is disabled. I can see later what I will put (first child, sitemap, etc.). <div class="container"><div class="grid-three-fourths float-center"> is specific to this project. <span class="dropdown-show">+</span><span class="dropdown-hide">-</span> logically only has to appear when there is at least one child. I've started testing things with a menu (with a function) I have for one website, but as you can see the sub-link structure is quite different from the link structure. The homepage link should stay a simple link with no drop-down. I need help from the masters . Thanks in advance. Have a nice week! NB: can someone change from Processwire to ProcessWire in the title of the topic please...
-
Hello, Whatever you think about the article at tutsplus, there is still a quality article awaited at http://opensource.com/tags/open-cms-column. See https://processwire.com/talk/topic/2311-processwire-on-the-web/?p=96919. Have a nice weekend!
-
Make directory writable by php and cache file
Christophe replied to eze102's topic in Getting Started
Where are you developing? On a local host or on a(n) remote/online host(ing) (which one)? Can we have more details about the platform (Windows, Mac OS X, Linux...), the LAMP setup (WAMP(SERVER), XAMPP, EasyPHP...), etc.?- 6 replies
-
- cache
- directories
-
(and 2 more)
Tagged with:
-
How to import table of data into ProcessWire
Christophe replied to Tony Carnell's topic in General Support
I guess $myDB could be anything else. And that Database() is like Page(), something related to ProcessWire. But I could be wrong . -
Allow translators to work on "hidden" language
Christophe replied to maba's topic in Multi-Language Support
Hello again, You could try, for example, something like: # Redirect from Subfolder to Root RewriteEngine on RewriteRule ^en/(.*)$ /$1 [R=307,NC] RewriteRule ^se/(.*)$ /$1 [R=307,NC] (Did you choose 307 on purpose?) (Had you submitted a sitemap.xml to Google (Webmaster Tools)?) NB: perhaps it would work with RedirectMatch without the first slash(?). Just wondering... -
Allow translators to work on "hidden" language
Christophe replied to maba's topic in Multi-Language Support
@tkaranka Hello, I created a multilingual website (just a few pages for the moment) not long ago (Processwire 2.6.1). With French as the default language (default fr) and the old/default default language as the secondary language (en en). I have Language "fr" enabled for the guest user. In the backend I only have the "fr" tabs activated (*). I didn't comment out the language switcher (but I could also). I have only "fr" at the top of the website (that I could hide with css, for example, if I wanted) (*). My "Default language homepage is same as root URL". (*) For Languages > en > Settings > Status, I have "Hidden: Excluded from lists and searches" currently enabled. If this is enabled, if I add en to http://domainname.tld/ I arrive on a "404 Page". I didn't uncheck "Active?" in the homepage Settings (the setting is visible only if "Hidden: Excluded from lists and searches" is not enabled). In the source code I have: <link rel='alternate' hreflang='fr' href='http://domainname.tld/' /> On all default pages except the homepage, /fr/ is added to the url. (Did you try with RewriteCond and RewriteRule?) -
Creating new responsive theme based on Foundation
Christophe replied to formmailer's topic in Themes and Profiles
Some interesting alternatives among others: uikit, semantic ui, kraken, pure... NB: I've just noticed that skeleton has a new website Edit: I have just found (again?) http://materializecss.com/ Edit 2: apparently materialize is also supported in Pinegrow- 10 replies
-
- getting started
- responsive
-
(and 2 more)
Tagged with:
-
@mr-fan: I don't know why I didn't try with an if...else statement. Perhaps I had been too long on the computer... I also have a commented version for the first menu. @Cerulean: this time, just using $rootPage = $page->rootParent; is enough. It's possible I used $rootParent here or somewhere else once without really knowing what I was doing, but then changed it as I was testing things in multiple tabs, and couldn't find it back later. And perhaps I also did like just now: I forgot to upload the file again in FileZilla. Thank you both! I will also later look (if and) how I can use Drop Jumbo [ http://cferdinandi.github.io/drop/ ] with MarkupSimpleNavigation. (The Drop Basic demo is going to be fixed. It seems that, since the new version and website were released a few days ago, it doesn't work anymore.)
-
Hello Soma, Where can version 1.3.4 be found? Perhaps it can help solve my "issue". Have a nice day!