Jump to content

MikeB

Members
  • Posts

    48
  • Joined

  • Last visited

Everything posted by MikeB

  1. I have used the field in a formbuilder form. I get the error if I complete the field on submission of the form. If I leave the field blank (It is optional) I get no error. Hope this helps you track it down. Anything else I can send you to aid in debugging?
  2. I am continuously getting the same error flagged. Do you have any ideas what I could be doing wrong. I have checked again and again, re-read the documentation countless times. Still can not see what I have done wrong. If you need any more information let me know. I have just today updated to the latest version and the issue persists.
  3. Ryan replied back to my issue on the Form Builder support forum. Here is the solution he suggests. And the way I did it myself, before I saw his post: Both work, but it's my guess that Ryan's is the better way, as he has way more experience then I have.
  4. An update to the xsl sylesheet above. Tablesorter is not required for zebra striping, and so jquery is not required. Added CSS3 nth-child(odd) styling instead. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>XML Sitemap</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <style type="text/css"> body { font-family: Helvetica, Arial, sans-serif; font-size: 18px; color: #545353; } table { border: none; border-collapse: collapse; } #sitemap tr.odd { background-color: #eee; } #sitemap tbody tr:hover { background-color: #ccc; } #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a { color: #000; } #content { margin: 0 auto; width: 1000px; } .expl { margin: 10px 3px; line-height: 1.3em; } .expl a { color: #da3114; font-weight: bold; } a { color: #000; text-decoration: none; } a:visited { color: #777; } a:hover { text-decoration: underline; } td { font-size:14px; } th { text-align:left; padding-right:30px; font-size:12px; } thead th { border-bottom: 1px solid #000; cursor: pointer; } tbody tr:nth-child(odd) { background-color: #E8E8E8; } </style> </head> <body> <div id="content"> <h1>XML Sitemap</h1> <p class="expl"> Generated by <a href="http://processwire.com/">Processwire</a> this is an XML Sitemap, meant for consumption by search engines. </p> <p class="expl"> You can find more information about XML sitemaps on <a href="http://sitemaps.org">sitemaps.org</a>. </p> <p class="expl"> This sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs. </p> <table id="sitemap" cellpadding="3"> <thead> <tr> <th width="75%">URL</th> <th width="12%">Last Change</th> </tr> </thead> <tbody> <xsl:for-each select="sitemap:urlset/sitemap:url"> <tr> <td> <xsl:variable name="itemURL"> <xsl:value-of select="sitemap:loc"/> </xsl:variable> <a href="{$itemURL}"> <xsl:value-of select="sitemap:loc"/> </a> </td> <td> <span> <xsl:value-of select="sitemap:lastmod"/> </span> </td> </tr> </xsl:for-each> </tbody> </table> </div> </body> </html> </xsl:template> </xsl:stylesheet>
  5. Thanks Gayan, I have also opened a thread on the Form Builder forum to see if anyone there can help. If I get an answer here or there I will cross post so it is available in both places. I did this as I was not sure where the issue is. More then likely something I am doing wrong due to my lack of PHP knowledge. Thanks once again for the excellent work you did here.
  6. First of, Gayan thank you very much for this excellent profile. I am using this as a starting point on all my own profiles for client work. I have made additions/modifications, but the basis is the same. One question I have is with regards to passing variables on through to the functions in _functions.inc and then on to templates. Specifically I am using Ryan's excellent form builder module. And would like to use his embed method C to embed the form directly into my template. The template I want to embed into is a new version of page-block-type-x. To get the form embedded on to a page is easy. Just include the following in the _init.php file $form = $forms->render('contact'); Then use this on the page template. echo $form; However if I add the second to my page-block-type-x template it says "undefined variable form" I have tried putting the first "render" part into the function in _functions.inc, but then it says "undefined variable forms" Any ideas how I can get this data/variables to bubble through to the partial template?
  7. I would just like to add something to Ryans great template code. I think this may be helpful for some. To add some styling to the output, you can: In "renderSitemapXML" function, change the following $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; to this $csspath = wire('config')->urls->templates; $out = '<?xml version="1.0" encoding="UTF-8"?>' . "\n" . '<?xml-stylesheet type="text/xsl" href="' . $csspath . '/css/xsl-stylesheet.xsl" ?>' . "\n" . '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">'; Then include this file "xsl-stylesheet.xsl" in your "css" directory. <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:image="http://www.google.com/schemas/sitemap-image/1.1" xmlns:sitemap="http://www.sitemaps.org/schemas/sitemap/0.9" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/> <xsl:template match="/"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>XML Sitemap</title> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script> <script type="text/javascript" src="http://tablesorter.com/jquery.tablesorter.min.js"></script> <script type="text/javascript"><![CDATA[ $(document).ready(function() { $("#sitemap").tablesorter( { widgets: ['zebra'] } ); }); ]]></script> <style type="text/css"> body { font-family: Helvetica, Arial, sans-serif; font-size: 18px; color: #545353; } table { border: none; border-collapse: collapse; } #sitemap tr.odd { background-color: #eee; } #sitemap tbody tr:hover { background-color: #ccc; } #sitemap tbody tr:hover td, #sitemap tbody tr:hover td a { color: #000; } #content { margin: 0 auto; width: 1000px; } .expl { margin: 10px 3px; line-height: 1.3em; } .expl a { color: #da3114; font-weight: bold; } a { color: #000; text-decoration: none; } a:visited { color: #777; } a:hover { text-decoration: underline; } td { font-size:14px; } th { text-align:left; padding-right:30px; font-size:12px; } thead th { border-bottom: 1px solid #000; cursor: pointer; } </style> </head> <body> <div id="content"> <h1>XML Sitemap</h1> <p class="expl"> Generated by <a href="http://processwire.com/">Processwire</a> this is an XML Sitemap, meant for consumption by search engines. </p> <p class="expl"> You can find more information about XML sitemaps on <a href="http://sitemaps.org">sitemaps.org</a>. </p> <p class="expl"> This sitemap contains <xsl:value-of select="count(sitemap:urlset/sitemap:url)"/> URLs. </p> <table id="sitemap" cellpadding="3"> <thead> <tr> <th width="75%">URL</th> <th width="12%">Last Change</th> </tr> </thead> <tbody> <xsl:for-each select="sitemap:urlset/sitemap:url"> <tr> <td> <xsl:variable name="itemURL"> <xsl:value-of select="sitemap:loc"/> </xsl:variable> <a href="{$itemURL}"> <xsl:value-of select="sitemap:loc"/> </a> </td> <td> <span> <xsl:value-of select="sitemap:lastmod"/> </span> </td> </tr> </xsl:for-each> </tbody> </table> </div> </body> </html> </xsl:template> </xsl:stylesheet> You can of course put the file anywhere else, just change the path in the code. Also you can adjust the styling to suit your taste/site. I hope this helps someone. P.S. though I have called the file a "stylesheet" it is actually an XSL Transformation You can read more here http://www.w3schools.com/xsl/xsl_intro.asp
  8. OK kill me for being an idiot. To show my client the progress I am making I posted the dev site up to the server for him to see. Now sometimes, I get confused as to which I am looking at for front end, and which i am developing. I need to do SCSS on local machine, and keep pinging back and forth. So what happened is that down on local I changed the function to nice and simple as I described above. But on local I had forgotten to move the full articles under the summary. So that did not work. Meanwhile up on the server I had moved them, but still had old code working out the link, which is what I was trying to tidy up. Now have everything back in sync. Note to self : Stop working on either local or dev, just use one, then sync at the end. Thank you all for your patience and time. That was my bad. I need to tidy my development process.
  9. Almost what I am trying to do, but here is exactly as best I can describe. I first find a bunch of pages($infoBoxes) with a certain parent and made of a certain template. I then iterate over them assigning them as a variable($infoBox). Now I want to find the child page of that $infoBox and use it's url for a link to that page on it's parent. Think like this, an image appears on my front page, there are a number of them. When you click them a pop-up appears with a summary of the article and a "Read More" link. That link takes the user to the full article. The full article is a child page of the summary in the processwire tree. You can see this in action, or nearly, as the link is not working yet. But look here , scroll to the "info" section and checkout the first item, select it and you will see the pop-up with "Continue Reading". Everything you see on the front page for each info article is in one processwire page for each, and the full article is a child of that page. P.S. I thought as only one child I did not need the $pages array, so instead of children I was using child.
  10. Once again I am stumped on something I feel I should know, and thought I did. I won't bore you with the full code of my function but here are the relevant snipets. function infoBoxesShow() { $infoBoxes = wire("pages")->find("parent=/info-articles/, template=infoItem"); $infoCategories = wire("pages")->find("parent=/info-categories/, template=infoCategory"); $out .="<div id='grida'>"; foreach ($infoBoxes as $infoBox) { foreach($infoBox->infoCategory as $tag) { $tagname = $tag->name; } $child = $infoBox->child->url; /*Here is my issue, this is not getting picked up*/ Then further down the function the url should be output in a popup to get to the "Continue Reading ..." page. $out .="<div class='white-popup mfp-hide' id='{$infoBox->name}'>"; // PopUp Content $out .="<div class='media-box-title'>{$infoBox->headline}</div>"; // PopUp Title $out .="<div class='media-box-date'>{$infoBox->publish_date}</div>"; // PopUp Date $out .="<div class='media-box-text'>"; // PopUp Text $out .="<p>{$infoBox->summary}</p>"; // Some Content Here $out .="</div>"; // End of PopUp Text $out .="<div class='media-box-more'>"; // Read More $out .="<a href='{$child}'> {$infoBox->more_link_text} </a>"; // Link /*$child is not printing anything*/ $out .="</div>"; //End of Read More For the most part i think I have a reasonable understanding of Processwire API, until something like this throws me. Any ideas what I am doing wrong?
  11. Hey guys, i am trying this module out on my development (Local) server before deploying to staging server. I am currently having an issue with CSS URL rewrites. My Local implementation of processwire for the site I am developing is at http://localhost/sitename/ I have tried with config file to add host 'localhost' and 'localhost/sitename'. Neither seems to make a difference the module is rewriting to http://localhost/site/templates/css/{fonts or icons}/filename Any ideas what i should be doing, for instance would this work if I moved the directories for fonts and icons up to just under /templates/ ?
  12. Finally got that fixed. I had downloaded and installed "AdminRestrictPageTree" and assigned to "guest" and "manager". I assumed it would just hide the actual full tree leaving my listerpro lists of pages i want managers to be able to edit. No idea why guest is in there as they can not access that page anyway. Instead it rendered everyone unable to login due to a page redirect loop. I guess the issue was my own fault, I did not have a page to redirect them to, as I did not understand it was going to stop them getting to the admin page altogether. Guess that will teach me to be sure i know what i am doing with contributed modules. Have removed that module now after editing database to remove restricted roles and once again gaining access to the site admin. I guess the reason I could no longer get in was due to the guest role being added to restricted users.
  13. Have just downloaded new version of processwire dev, then emptied cache, sessions on the database. Tried login as superuser, and get the same message. Have checked and cookies are stored. See screenshot. Checked the single entry in session and here is the output. Session|a:3:{s:5:"_user";a:2:{s:2:"id";i:41;s:2:"ts";i:1416583150;}s:27:"ProcessWireUpgrade_branches";a:2:{s:3:"dev";a:5:{s:4:"name";s:3:"dev";s:5:"title";s:11:"Development";s:6:"zipURL";s:63:"https://github.com/ryancramerdesign/ProcessWire/archive/dev.zip";s:7:"version";s:5:"2.5.8";s:10:"versionURL";s:92:"https://raw.githubusercontent.com/ryancramerdesign/ProcessWire/dev/wire/core/ProcessWire.php";}s:6:"master";a:5:{s:4:"name";s:6:"master";s:5:"title";s:13:"Stable/Master";s:6:"zipURL";s:66:"https://github.com/ryancramerdesign/ProcessWire/archive/master.zip";s:7:"version";s:5:"2.5.3";s:10:"versionURL";s:95:"https://raw.githubusercontent.com/ryancramerdesign/ProcessWire/master/wire/core/ProcessWire.php";}}s:7:"message";a:4:{i:0;a:2:{i:0;s:29:"mbrett5062 - Successful login";i:1;i:0;}i:1;a:2:{i:0;s:35:"Your ProcessWire core is up-to-date";i:1;i:0;}i:2;a:2:{i:0;s:27:"Your modules are up-to-date";i:1;i:0;}i:3;a:2:{i:0;s:48:"Saved cache - ProcessWireUpgradeCheck_loginHook";i:1;i:2;}}} As you can see it says i am succesfully logged in. But the page redirect is not working, gets caught in a loop. Previuosly I could login as superuser, but not manager. Now I can not login at all.
  14. Oppps sorry I forgot I already had an issue open about this, see https://processwire.com/talk/topic/8182-unable-to-login-as-any-user-other-then-superuser/ Though that states i had it fixed, but now that is no longer true.
  15. I have for sometime now been unable to login as a test user to verify what my real users will see. I get an error telling me: I did have this same problem a while ago, and it was seemingly fixed by updating to 2.5.8 but has subsequently returned. I have tried removing some modules that could impact logins and sessions, testing after each one is removed but still to no avail. Have also set sessionFingerprint and sessionChallenge to false and still no go. I can login as superuser no problem, but as soon as I try with an account with another role I get that message. Also once i have done that any attempt to get to admin page sends same error. have to clear the cache/cookies and everything else to get back to normal. Does anyone else have this probem, could someone please try and let me know. For the life of me I can not see what is causing the issue.
  16. No problem, and yes I agree with everything you say. The point of this "fix" was specifically for Windows 8/8.1 OS not anything else, where 'localhost' is legitimate and causes no issues. When I said culprit I meant the actual thing that fixes the issue. This is a bug in Windows 8/8.1 only as far as I have been able to find out.
  17. I have been seeing slower and slower response times on Processwire and Drupal sites on my local Xampp server for a while now. Just spent a couple of hours searching for some hints/fixes. Thought I would share this here as the answer I found that worked for me was reported on Wampp as well and using Joomla and Wordpress so seems to be across the board. I am running Windows 8.1 64bit. That seems to be where the issue stems, and has to do with a bug in that operating system with how they handle IPV6 first then fallback to IPV4. The way this manifests is frequent calls to the database being repeated, increasing server response times. So the fix is as follows. In phpMyAdmin\config.inc.php change $cfg['Servers'][$i]['host'] = 'localhost'; to $cfg['Servers'][$i]['host'] = '127.0.0.1'; This one I did not actually need as Xampp had that already, but according to the thread I found Mampp did need it. Next uncomment bind-address="127.0.0.1" in mysql\bin\my.ini And finally the real culprit, in Processwire site\config.php change the database configuration from $config->dbHost = 'localhost'; to $config->dbHost = '127.0.0.1'; This same applies for any CMS config file that connects to a MySQL database. (Maybe even any other database too as the issue is with OS) And hey, WOW!! my local dev sites are running way faster now. Hope all that is clear, and useful if anyone else is seeing slow response times locally. Just in case here is my current setup details. Windows Version: Windows 8 Enterprise 64-bit XAMPP Version: 1.8.3 Apache/2.4.7 (Win32) OpenSSL/1.0.1e PHP/5.5.9 MySQL Community Server (GPL) 5.6.16 libmysql - mysqlnd 5.0.11-dev phpMyAdmin Version information: 4.1.6
  18. Finally got this fixed, however I was stupid and did 2 things at once without testing between. Just goes to prove i am really not a developer, my bad. Any way, I removed "Dashboard" module but it left the page in place, and also the page "admin" then had no process attached, checked with my clean install and added back the ProcessHome. I think when Dashboard is installed it changes that to ProcessDashboard but does not change back on uninstall. I then updated to 2.5.8, and finally tested and it works, can now login to backend as anyone with manager role. I guess to finally put this issue to bed I should role back and test if the fix was removing Dashboard module or upgrading to 2.5.8. Please note, removing Dashboard did not create the issue in the first place, as it's removal was one of my steps to fix the issue.
  19. OK have tried with removing a number of modules that I have installed recently for SEO and redirects and maintenance mode and anything else that could be messing with logins. Nothing works. Not sure what my next steps should be now, short of starting again, rebuild the site from a clean install. Checking all the way that the manager role is useable.
  20. OK here is what I did. Download new copy of 2.5.7 and install with intermediate profile. Create a manager role and assign edit permission. Assign manager edit on Home template. Create new user with manager role. Logout, then login with new user. Viola!! It worked. So now what? Where could this be going wrong. I wonder about the following: Admin Theme, real dev site uses Reno Dashboard module No idea what else it could be, will try now and remove the dashboard module, then change admin theme, then start remove modules one by one based on relevance to the site.
  21. Tried new user with same role, and diffrent browsers (I always test everything on Firefox, Chrome, IE and Safari) Just tried incognito and same results. I had also given manager role permission to edit at the top level "Home" template, in case it was a permission issue. That should cascade down to everywhere unless excplicitly set further down the heirachy. Only thing left to test is a blank install of 2.5.7 thats up next. Let you know how that goes soon.
  22. Thanks, but if the problem was my environment why can I login as the superuser. My environment knows nothing about that, it is internal to processwire. I have tried everything I can think of external, and no luck so far. I am thinking maybe fingerprinting on login/session. Something somewhere is saying, this user only on this machine or at least, redirect other users on this machine and getting the redirect wrong. Pretty sure it never did before, but if it did, then IMO that is not good for development. By the way, link you sent is more Drupal specific, never had this issue on Drupal, but thanks anyway.
  23. Sorry, here is the responce from firefox. I have checked the server, and I see nothing wrong, like i said, i can login as 'me' superuser. I just need to keep clearing broswer cache and cookies.
  24. No, just normal login to admin. Here is a screenshot of 'net' tab from from firebug. I have set not redirect, no code, nothing. Just normal prosswire functionality.
×
×
  • Create New...