-
Posts
4,077 -
Joined
-
Last visited
-
Days Won
87
Everything posted by horst
-
Best practices for creating fields/templates in a module
horst replied to gRegor's topic in Module/Plugin Development
Sounds good, both alternatives. I think it depends on what you want to do with the module to choose the one and not the other. And according to this there pops up a question: How will you handle the created fields and templates by uninstalling the module? Do you want to remove all pages created through the module and the templates and the fields, or do leave it there? -
nice to know, but at uberspace there is no need to work around not writeable wire folders: As I understand this, PHP can write to all your own directories, but every one cannot. So, uberspace is not a "cheap" shared hosting, technically. PHP only needs 0755 here, whereas on many other (cheap) shared hosts it would need 0777 what should be avoided.
-
@adrian: good call!
-
@bytesource: please can you fill in the following gaps? add the fullpath for all requested files or directories here, but for the not web accessible part use the alias "docroot". So your webroot will be written: docroot/ - where is your processwire index.php: docroot/ - path to the Processwire .htaccess file: docroot/ - path to the site/config.php: docroot/ - where is the responsive-images.php: docroot/ Cheers, Horst
-
Hi @formulate, welcome to the forums! If I understand right, you first create csv-files from the iso-8859-1 site, then you import them into PW with the csv-importer module? Why not simply convert the whole iso-files to utf-8 files before using them for the import? ------------------ There is a case study from a (lets call it 'more customized') import scenario with a W**dPr*ss site. I have done something similar with a DB from another system (Gallery2). Maybe this is of interest for you? If you do know the DB structure of the old system good enough, so that you can query the right things in the right order, you may be able to setup a single script that does the whole import in greater chunks. Importer scripts are easy but powerfull. If you are interested we can point you to other examples or assist in building yours (if you know enough of the old system structure and how to query it).
-
@adrian: the context of that FTP transfer is _only_ for shared hosting environments where you are not in the comfortable situation to have wire folder write access without setting it to write for all (0777). But I don't know of any shared hosting environments that does _not_ have FTP enabled. But I do know of many that also do not have SFTP / SCP or SSH. Some may have FTPES. So, FTP is already enabled on those Servers, why not using it for transferring from local file system to local FTP? I cannot see any downside here. If you have your own server or are not in (cheap) shared hosting, you always can use other ways I believe. Maybe @NorbertH has quoted a to small piece of Ryans statement, so that it got a bit out of context?
-
I have got it from your provided htaccess file somwhere around Line 220, conditions for ProCache.
-
Best way to implement a global utility function?
horst replied to jordanlev's topic in Getting Started
I use my own utility function files in my site-profiles in a subfolder called for example: 'mylibs' I include them once in the site/config.php file: include_once(dirname(__FILE__) . "/mylibs/myfunctions.php"); This way I can use all what is in my utility files every where, regardless if I run PW in the webserver or if I bootstrap it for CLI operations. -
You mean I should use double-quotes for better readability? You are right! I will try to do so. (but may be hard for me, )
-
@bytesource: does this match like Oliver said? RewriteRule .* responsive-images.php?swidth=%4&pwidth=%5&pxratio=%6 [QSA,L] or should be better something like: RewriteRule .* %{DOCUMENT_ROOT}/processwire/responsive-images.php?swidth=%4&pwidth=%5&pxratio=%6 [QSA,L]
-
To avoid those if isset etc. you can list all your variables that you use in some templates initially in the _init.inc or what ever you use that is loaded before all others. (At least, you also could do it in the site/config.php, but I wouldn't) _init.php: $sorted = ''; // if it is for Output, I use an empty string initially $variable1 = ''; $variable2 = ''; $variable3 = '';
-
@NorbertH: Yes, this shouldn't matter in this case because WellKnown-OpenSource-Files are transferred from local filesystem to local FTP server only.
-
a brave or lion-hearted but very eclectic version can be made out of this: http://upload.wikimedia.org/wikipedia/commons/a/af/House_sparrow_chick.jpg
-
Please, based on a version of Reno, - and could it be that way that the advanced features are only but automatically displayed for superusers? So editors or others can use the theme, but without the advanced features.
-
I also don't know the code of the blog module from Kongondo. What I have understand is, that you have some pages belonging to template blog_category. I don't know if dogs, cats, fish, birds are the names of those pages or the titles, so please check and if they are the titles, please correct it in the find selector for the categories <?php // the names (not the titles) of your categories you want to output in the recent list for $categories = array('dogs', 'cats', 'birds'); foreach($categories as $category) { // find the category page and echo the title, [if it not has the template 'blog-category', please change here] echo "<h2>" . $pages->get("template=blog-category, name={$category}")->title . "</h2>"; // find the (limit) latest posts of category=$category, - if there are any, display title as link and a brief summary $latestposts = $pages->find("template=post, category={$category}, sort=-created, limit=2"; // if the above doesn't work, you may try this, if category is a pagefield in the post-page //$latestposts = $pages->find("template=post, category.title={$category}, sort=-created, limit=2"; if($latestposts) { foreach($latestposts as $latestpost) { echo "<h3><a href='{$latestpost->url}'>{$latestpost->title}</a></h3><p>{$latestpost->summary}</p>"; } } } ?> Jan Romero has shown you the right way already, but your code-fragments and your explanation of what you are after are not very clear, at least for people who haven't worked with Kongodos blogmodule. So if it doesn't work, please come back and explain a bit more exact what you have done, which part works and which not.
-
Show entire page tree as a dropdown under PAGES in Admin?
horst replied to Thomas108's topic in Getting Started
Ah, ok. No it will not change in behavior. And no, I don't know of any tool that does that. I'm not sure, but I think no, there also isn't what you are asking for, but you may have a look to the admin themes section by yourself. -
Show entire page tree as a dropdown under PAGES in Admin?
horst replied to Thomas108's topic in Getting Started
with the new PW 2.5 (what will be released very soon, or you can get in the dev-branch on GitHub) you can use Tree and Find. Do you know Find? -
I think this is sort of a syntax error: default: ; break; You need to add something between default: and ; Or you let it out if you do not want to specify a default! switch($sort) { case 'asc': $sort = "name"; break; case 'desc': $sort = "-name"; break; } http://php.net/manual/en/control-structures.switch.php
-
@SteveB: you may compare how it is built / used with WireMailSwiftMailer or WireMailSmtp. Both are modules that set on top of the base class and just working fine. So, without knowing how you have coded it, I cannot tell you more than to compare yours to those and refer to their examples. -------- It also is possible to check for the right module like so (logging isn't necessary): $mail = wireMail(); if($mail->className != 'WireMailSendgrid') { // Uups, wrong WireMail-Class: do something to inform the user and quit echo "<p>Couldn't get the right WireMail-Module (WireMailSendgrid). found: {$mail->className}</p>"; return; } As a sidenote, you should only install one module on top of the base class. I have encountered that, if you install two, the last one installed is used. I don't know of any method to select from different modules through the WireMail base class.
-
I think it should be page, not pages: $this->pages->addHookBefore('save'
-
Combining pages from multiple page select and children (limit=xx)
horst replied to MuchDev's topic in General Support
I'm in a hurry: https://www.google.com/search?q=site:processwire.com+pagination https://www.google.com/search?q=site:processwire.com%2Ftalk+pagination https://processwire.com/api/modules/markup-pager-nav/ (limit) ... -
<?php echo $member->get($page->name)->title; ?>
-
Very cool story! And a very wise decision to switch to PW without telling the client to early. (only after they have seen it live) it makes me:
- 33 replies
-
- 1
-
- Photography
- Travel photography
-
(and 1 more)
Tagged with:
-
He, if I get you right, you have version 2.4.10 installed and want upgrade to 2.4.17 (or the latest version available)? you should make a DB-backup rename your current wire folder to something like wire-2410 rename your current index.php to index.php.bak or something and then upload only the wire folder of the latest version and the index.php Regarding changes in the .htaccess file I have compared the 2.4.9 against the 2.4.17 and there were only 2 new lines added (row 150 + 151): # ----------------------------------------------------------------------------------------------- # Access Restrictions: Protect ProcessWire system files # ----------------------------------------------------------------------------------------------- # Allow screenshot files (for install.php only: this 1 line below may be removed after install) RewriteCond %{REQUEST_URI} !(^|/)site-[^/]+/install/[^/]+\.(jpg|jpeg|png|gif)$ # Block access to any htaccess files RewriteCond %{REQUEST_URI} (^|/)\.htaccess$ [NC,OR] You need to update that manually. Then you should start the site by log into the admin and also view your site from the frontend.