Jump to content

jan

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by jan

  1. Hi everybody, and sorry for my bad english in advance… I work often with ProcessWire, and I'd like to share my thoughts about some characteristics of ProcessWire that make work hard sometime. My thoughts are mostly based on the idea of making ProcessWire more flexible, but preserving it's simplicity. I think everybody who's working on websites daily, will recognize the problems I describe here. (I think it's got to do a lot with that thing "responsive layout" ) So I made a short presentation, which should be seen as a first step. I'm really looking forward to your feedback, community. (Presentation is attached as PDF at bottom of post). If you have any questions, please ask me. I'm also happy about other ideas, how to solve the problems described. Thank you! Presentation as PDF: ProcesswireFuture.pdf
  2. Thank you! This solved the error for me.
  3. Thank you for this very helpful piece of code, Ryan I use the sitemap for a multilanguage site (two languages only – en and de). Englisch is default (www.domain.net), German is de (www.domain.net/de) Referring to this article (https://support.google.com/webmasters/answer/2620865?hl=en or in German https://support.google.com/webmasters/answer/2620865?hl=de) I extended the "renderSitemapPage" function to indicate which page is a translation (and which language the current page is). It's not really automated / generic for more languages, and I also added "https://" manually. But it might be a help for someone. If anyone want's to optimize – you're welcome! function renderSitemapPage(Page $page) { return "\n<url>" . "\n\t<loc>" . $page->httpUrl . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>" . "\n\t<xhtml:link rel='alternate' hreflang='de' href='https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "' />" . "\n\t<xhtml:link rel='alternate' hreflang='en' href='". $page->httpUrl . "' />" . "\n</url>" . "\n<url>" . "\n\t<loc>https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "</loc>" . "\n\t<lastmod>" . date("Y-m-d", $page->modified) . "</lastmod>" . "\n\t<xhtml:link rel='alternate' hreflang='en' href='". $page->httpUrl . "' />" . "\n\t<xhtml:link rel='alternate' hreflang='de' href='https://". wire('config')->httpHost.$page->localUrl(wire('languages')->get("de")) . "' />" . "\n</url>"; } With this function you only have to submit www.domain.net/sitemap/ to google to include both languges. Attention: www.domain.net/de/sitemap generates a faulty sitemap with the code above and should not be submitted to google. One more thing to do: To make the markup valide, you also have to add the namespace in the urlset-Element: function renderSitemapXML(array $paths = array()) { $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xhtml="http://www.w3.org/1999/xhtml">';
  4. The issue was already reported in February: https://github.com/ryancramerdesign/ProcessHannaCode/issues/3 I now posted it to the Hanna Code thread: https://processwire.com/talk/topic/3745-hanna-code/page-10#entry75194
  5. jan

    Hanna Code

    Hi, I just can't find my github login, so I'd like to report a minor bug here. (I did cost me some hours…) In the description of the Hanna Code Name field is written, that hyphens are allowed in names: That's definitely not right. as you can read here: https://processwire.com/talk/topic/7123-embedding-css-grid-markup-in-textareackeditor/ Hanna Code Module is not working with additional parameters if hyphens are in the Hanna Code Name. This error was also reported on github in February here: https://github.com/ryancramerdesign/ProcessHannaCode/issues/3 The module is great anyway. So thanks a lot in advance!
  6. Oh my god!! I trusted so much in PW, I never thought this could be a problem!!!! Thank you a lot kongondo! And yes it is a hyphen. And it's also proofed in letters: Problem solved.
  7. I thinks it's not exactly your question, but I also remember a lot of problems with php mail and encoding… If every thing works in the body part of the mail, but you have issues with umlauts in the subject try: $subject = '=?UTF-8?B?'.base64_encode($subject).'?=; Good luck
  8. Thanks for all your efforts cstevensjr!!!! This is exactly what I'm trying to do. The tag="div" (as you can see on pic 1) is only a default value, if the parameter is not passed. No parameter is never passed at all All these do NOT work and do not render anything out: [[open-col-3,tag=div]] [[open-col-3, tag=div]] [[open-col-3 tag=div]] [[open-col-3 tag=div]] [[open-col-3 tag=aside]] and so on I'm 99% sure, something with the module is not working correctly. Perhaps the chief commander can say something about it! (<- this one somehow looks like Ryan, doesn't it?) Perhaps an issue that came within PW 2.5? I'd be really glad for an answer! That would be very kind! PS: Workaround for now is of course to make specific hanna codes for all occurring case like [[open-col-3-div], [[open-col-3-aside] and so on. Not a very elegant solution…
  9. I still don't get the clue. I refer to passing a variable to my php code via the hanna code attribute: I created two hanna codes: Then I selected "php" and preset the attribute "tag": On the code tab I echo the preset/ passed value of "tag": The hanna code renders well as long as I do not try to pass the attribute via hanna code: This works: [[open-col-3]] (result is: <div class="large-4 columns">) This does not: [[open-col-3 tag=aside]] (result should be: <aside class="large-4 columns">) So pleasssssssss tell me where my mistake is! Thanks so much!!
  10. Sorry, but I don't understand. If I use the preset param (via Basic tab -> Attributes, as mentioned above) it works perfectly! If I try to set it manually/ overwrite it via the shortcode attribute, it does not work. I also tried to simply echo the passed param inside <p></p>, which does not work either. Sorry if I missunderstood your reply. (I also created another seperate Hanna Code close-col to close the opened element and keep my code valide.)
  11. I have problems using the Hanna Code module. It works perfectly without parameters. But if I try to use params it fails. Here is my setup. I created a Hanna element named: open-col-3 In the attributes field I preset my param: elem=div My php in the code tab is: echo '<'.$elem.' class="large-4 columns">'; If I now use the shortcode in the content field of my page [[open-col-3]] it renders to <div class="large-4 columns"> If I try to pass the param like [[open-col-3, elem=section]] or [[open-col-3 elem=section]] it fails and no html is rendered. Does anyone have an idea why it's not working? I use PW 2.5.0 with CKeditor. Thanks in advance!!
  12. Currently I'm using Processwire and Foundation for a web project. Just came to the forums, did a search, found what I need and DONE. Thanks!
  13. Thank you very much!! This is the solution.
  14. Hi there, I have a template with a field type page. Now I try to remove one of the pages inside this field. I think I'm kind of blind – it won't do what I want it do foreach ($myPage->pageField as $pageInField) { if( /* condition to find page to remove */ ) { $myPage->pageField->remove($pageInField); break; } } Thank you!!!
  15. Hi, I have to reactivate this elder topic. I'm trying to add a page selector field containing the users of a specific role as descriped above. I also want, that the (non-admin) useres (role: editor) can asign pages to other users (role: editor) [similar to a bugtracker]. If I try select users via the page select field I get the message: "You don't have access to list page /processwire/access/users/" Is there a secure way to enable the selection of users to non-admin users? Thanks for your reply!! PS: I'm using PW 2.4.0
  16. I've built a processwire website for a friend and had lots of problems with "this request was aborted because it appears to be forged" after putting it on the production server. Now, after some weeks of searching for the problem (also at the provider...) solution was very simple and I like to share: The Webspace on the server was full. And cause every visit creates a session (inside assets/sessions/ folder) no new session could be created (new sessions files were created, but size was zero). The result was the "forged" message. So perhaps this could be one more solution, if anyone else has this problem...
  17. Hi, I changed the preg_replace parameters a bit. Perhaps someone can use it. Cause if a user sets a "normal" link to an email address the result is: <a href="foo@foo.bar">email</a> The reg ex is looking for any link like that, and makes it to a correct mail link. $body = preg_replace('/\<a href="(\S+@\S+\.\S+)\>/i', '<a href="mailto:$1>', $page->body); echo $body; Result is: <a href="mailto:foo@foo.bar">email</a> I'm not the super expert for regular expressions. Perhaps someone can check, if this is correct. For me it seems to work. Thanks.
  18. Waiting for Processwire's versioning/ history function. This will be sooo coool. :)

  19. Ok, continuing the monologue: I helped myself, simply generating ANY new userAuthSalt. After that I used Ryans explanation to reset admin and user passwords: http://processwire.com/talk/topic/1736-forgot-backend-password-how-do-you-reset/?p=16163 Logins and everything else works fine now.
  20. Ok... I got it.... sorry. I'm using Netbeans on remote project. After installation it did't get the changes made by server in my local environment! So, I could not see db credentials in config.php in netbeans, but they were set in the file on the server. Now after saving config.php localy, netbeans overwrites what is on the server: db credentials were removed. Hope nobody will make the same mistake.. Now I lost $config->userAuthSalt. is there a way to restore it??
  21. Hi, I think I'm just getting crazy, because things happen I don't understand I try to transfer a processwire installation (v2.3.0) to another server. In site/config.php there are NO db credentials set by installer! Anyway the installation is working befor transfering it to a new server!! After transfering it's not working. I'm just wondering where processwire v2.3.0 gets db credentials from? Can anyone tell me?? Is something changed here?! PS: After changing ANYTHING (timezone) in site/config.php (of the first, working instance) and saving changes I get 500 Internal Server Error Log: Error: Exception: DB connect error 2005 - Unknown MySQL server host 'Config' (1) (in /var/www/spielplatz/conceptPlus/wire/core/ProcessWire.php line 96) HELP!
  22. I'll keep this solution in mind. But a simple textfield with comma-seperated values acutally is "ok" for my needs I'd have to change a couple of things if I use repaeter fields. So it would be nice, if theres another solution. And perhaps if there's no solution, this issue is worth, thinking about new capibilities of processwire core?! Thanks in advance!
  23. Sorry, unfortunatelly this is not working. An article that has image links but no image files isn't found. This also does not work: $pages->find("articleImageFiles|articleImageLinks!="); Any other ideas?
  24. Hi again, I've got one more problem with selectors. I need get pages from page array that have images uploaded (fieldtype image) a OR (logical) imagelinks (fieldtype text) set. Of course, it's no problem to get pages that have images uploaded AND imagelinks set: $pages->find("articleImageFiles.count>0, articleImageLinks!=''"); What I need is a query to get pages that have images uploaded, or imagelinks set, or both. So a logic OR is needed. Things like this unfoturnatelly didn't wok: $pages->find("articleImageFiles.count>0|articleImageLinks!=''"); So does anyone know how to combine the selector elements with logical OR? Thanks a lot to you all! Really a great community!!
×
×
  • Create New...