Jump to content

fruid

Members
  • Posts

    682
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by fruid

  1. I'm used to use _x('string', 'category') to fill all my language dependent needs with strings in templates. Now that I use a custom written php function that is included, this _x() function doesn't work anymore. #0 SITE/TEMPLATES/REFERENT.PHP (57): INCLUDE() #1 WIRE/CORE/TEMPLATEFILE.PHP (318): REQUIRE('/APPLICATIONS/M...') #2 WIRE/CORE/WIRE.PHP (394): TEMPLATEFILE->___RENDER() #3 WIRE/CORE/WIREHOOKS.PHP (823): WIRE->_CALLMETHOD('___RENDER', ARRAY) #4 WIRE/CORE/WIRE.PHP (465): WIREHOOKS->RUNHOOKS(OBJECT(TEMPLATEFILE), 'RENDER', ARRAY) #5 WIRE/MODULES/PAGERENDER.MODULE (536): WIRE->__CALL('RENDER', ARRAY) #6 WIRE/CORE/WIRE.PHP (397): PAGERENDER->___RENDERPAGE(OBJECT(HOOKEVENT)) #7 WIRE/CORE/WIREHOOKS.PHP (823): WIRE->_CAL (LINE 29 OF SITE/TEMPLATES/_FOOT.PHP) THIS ERROR MESSAGE WAS SHOWN BECAUSE: SITE IS IN DEBUG MODE. ($CONFIG->DEBUG = TRUE; => SITE/CONFIG.PHP). ERROR HAS BEEN LOGGED. any ideas?
  2. I have a php-script that should run after a form submission and in that php-script I would put a redirect to a success or error page respectively. so I add <action='/_myscript.php'> to the form. The script doesn't load though. What's the best practice for this? Where to put the script? root folder? site folder? template folder? and what would the path be because either way I try gives an 404 error or lack of access error. My guess is it absolutely needs to be/have a page?
  3. could someone walk me through what is required to upload files/images to some assets/files-folder from the frontend? All I can find online are general php-tutorials but no PW-tutorials and the PW-API-documentation is abstract to the point of complete confusion. I actually don't know what all these methods do exactly nor which ones are missing to make it work and how could I know? Here's what I did so far: if (isset($_POST['submit'])) { $path = $pages->get("id=1030"); $path->setOutputFormatting(false); $u = new WireUpload('fileToUpload'); $u->setMaxFiles(1); $u->setOverwrite(false); $u->setDestinationPath($path->images->path()); $u->setValidExtensions(array('jpg', 'jpeg', 'gif', 'png')); foreach($u->execute() as $filename) {$path->files->add($filename);} $u->save(); } <form action="<?php echo $page->url ;?>" method="post" enctype="multipart/form-data"> Select image to upload: <input type="file" name="fileToUpload" id="fileToUpload"> <input type="submit" value="Upload Image" name="submit"> </form> error: Exception: Method WireUpload::save does not exist or is not callable in this context many thanks
  4. I'm trying to install a multiple site installation as discussed here https://processwire.com/docs/more/multi-site-support/ Both sites are for the same client so I opted for option #1, different database, different web content, same PW installation. I already had worked on both sites separately, so now I just want to move one site to the root folder of the other PW installation where the other site folder sits. To my understanding, I need to change the config file to link to a different database and have different http-hosts. My question is, how do I get it to run on MAMP? In my htdocs folder I can only choose the main folder (in which both site-folders sit) and when I open that one it just shows me what's in site, not what is in site-2. thanks for help
  5. thanks for the quick answer and solution. I knew it had to be simple, works now.
  6. after migrating a site from localhost (MAMP) to live server, all the links are broken. I can only access the home-page (e.g. www.example.com), anything after a slash won't work (e.g. www.example.com/en/somepage), including /admin. It works perfectly on the local machine but not on the live server. What I did was to move the content from my local machine via ftp to the live server without previously installing a blank PW. Then I created a database, imported the database from my local machine and amended the database credentials (db-name, username, password) and also the httphosts-array. I had this issue before with another project, I think I fixed it by re-installing a blank PW-installation and only then replace the database with the one from my local machine. Is that the only way?
  7. how about "exact matches"? When I use the searchengine-module's demo-site, it seems to check for the exact match of each word of a search query in that very order. e.g. search queries (ignore the quotes): "scalability issues" returns 1 result "issues scalability" returns 0 results Some times you do not want exact matches and sometimes you do. When using Google, you soon figure out the use of quotes for an exact-match-query does the trick. Needless to say, that won't work here since the lack of quotes already returns exact matches. How to specify that on the frontend? Would there be a way to specify that by using/not using quotes? I want to avoid including yet another set of radio-buttons. thanks!
  8. just thought-showering here; would it be possible to replace the admin's entire cascade-style-dropdown-tree-layout (whatever you call it) to a table-layout instead or default to the finder-module? Might there be an admin-theme for that?
  9. I meant only for external links @dragan OK, thanks all for the suggestions and advice. I will reconsider now. In any case, good to know there's a module for this.
  10. Can I automatically add the attribute target="_blank" to all links created in a CKeditor body field?
  11. @kongondo agreed, my bad, thanks so far.
  12. so as mentioned above, I'm trying to use a combination of ProFields Table and ListerPro. I exported the table I created with the PageActionExportCSV within ListerPro to see how the data is structured so that I can then upload another list using the module ImportPagesCSV. But in the exported CSV file all the values of any column are in the same table cell of the same row instead of each in a new row, no matter what I do with Multi-value separators, CSV delimiters or CSV enclosure. Is that intended? If so, please explain why…
  13. Is there a way to simply select more images at once when adding them right inside the body-text? I can add images one by one no problem, so I would think that selecting more at once when adding them isn't too far fetched. Any more ideas on this issue? EDIT: The solution described above is rather for image galleries. I understand this can facilitate the upload procedure, upload to different galleries, repeated with a repeater-field and then included to the HTML with Hanna Code without the need of selecting images one by one anymore. This works fine when you know which images go above/below which text, but what if you want to upload all images at once to the page first (either to one field or more probably via FTP to the according /assets/file/page-folder/) and then, when entering/copy-pasting the text, select the images appropriately. If you have long articles (which is the case in my case) and up to 60 images, you still want to select more at once and not one-by-one. Also, I checked for CK-Editor-updates on Github. The current CKEditor-version on PW is 1.6.3, not to be confused with CKEditor4 or 5 version-numbering – I guess the module's version that comes with any new PW-installation is the newest anyway? What about addons/plugins from the ckeditor-page itself? ckeditor.com/cke4/addons. Personally couldn't find anything that meets my needs. Thanks for suggestions
  14. @kongondo no, I mean ImportPagesCSV.
  15. I installed ImportPagesCSV (thanks to Ryan) which seems to work like a charm, at least for pages – need to see for ProFields Table. The client has no problem with using that instead of SQL. Am I right to assume that this module is making proper use of the API? Upon upload, I hope that we'll be able to use ListerPro for bulk edits, even for ProFields Table and everything will be alright.
  16. the client insists that PW's database structure is not relational because some fields are redundant. Now I'm in doubt, did I screw up somewhere? As mentioned above, I thought some problems might arise when re-using the same fields on different templates, maybe that's what this is about? Also, now I'm mixing ProFields Table and ListerPro, not sure if that is wise, ProFields Table, to my understanding, simulates (for lack of a better word) a non-relational database but it really just is a field with subfields? If you mostly avoid the CMS-backend of the page and use ListerPro instead, what's the point in using ProFields Table? Are there any technical advantages? Because in terms of visualisation, everything's a table somewhere.
  17. yes, I figured, not a bug after all.
  18. I'm currently trying to get the hang of the module "Lister" (the included version) before I buy the ListerPro. I have to say, it seems a little bit buggy, doesn't always deliver results when it should. Particularly the selector "has_parent" doesn't seem to work properly. I'm using year-numbers as page-titles (2020, 2019, 2018) for the grandparents. It works when doing: parent… | Title | equals | 2019 but not: has_parent | equals | 2019 also, I can't seem to filter subfields – I'm using custom fields for images and also Profields Table – I wonder if that will work with ListerPro. Appreciate your help.
  19. The Joomla site was done decades ago. Sure we could have updated and stayed with Joomla, but it often feels like an overkill for what the site requires, leaving you with removing what you don't need instead of adding what you need. Same goes for Wordpress. Processwire gives you a blank markup to build on. That was the selling point. And we had to re-build the entire markup since it's so outdated. Lister itself (included with any new PW installation) is quite helpful and comes close to what a non-relational database looks like. Lister Pro, as mentioned, if I can figure out how to bulk import as well, I guess would be the best of both worlds, and would come close to the way the client is used to handle the data. I don't think we're well advised to yet again change horses, Directus would probably bring other complications, no CMS is perfect after all.
  20. The client really is a SQL-wizard, they've been running and maintaining a website for decades, with new content coming in or needing to be updated on a monthly basis, much of which is far too large to be handled manually via a CMS. So convincing him to use the CMS-input instead is quite utopian. And I think we are seeing the first symptoms of what was warned about when forgoing the CMS: many "pages" (to use PW way of thinking) have the same name. Upon SQL-import, the url defaults to the page's name which creates duplicates and the import thus breaks off. I guess that's something that wouldn't happen when using the CMS-input-method instead as newer entries with the same name (and the same url) would be serialized (i.e. appended with -1, -2, -3, etc.). I can imagine that more problems would arise that I cannot think of just yet and since the client's knowledge of the framework is also limited, how would they know other than by trial and error? Can you use ListerPro to bulk import as well? @MoritzLost
  21. I agree it's rare, and yet it's still the case. I don't know much SQL, am also not in charge of the database and the client IMO shouldn't have to learn the PW-API, as cool as it clearly is. yes indeed that's what they used to do before PW. That sounds like re-building huge parts of the site and I thought I'm almost done. What I wanted was for all fields to show more relation to other fields on the same page. Field-groups so to speak, as mentioned by @LostKobrakai Just as an example (and possibly another issue). I have a field on a template that always has a value (default-value). I have 19 pages with that template, yet only 14 rows in the field-table in the database. While I don't know why it wouldn't enter the value for 5 of those pages – like I said, different issue – I had a hard time figuring out which pages those are. What I did is to write: echo $page->id; on the allways included _main.php to see which id the page I'm looking at has. Then open all the pages manually and see which page-id is not in the said column. I'm sure there's a more pro-approach to that conclusion using the API, but for someone who doesn't use it at all, it remains a hassle. In any case, thanks @bernhard and @MoritzLost for your suggestions RockFinder3 and ListerPro respectively. I guess one of them (I reckon the latter) will be the solution and will have to replace the direct SQL-commands in the end. Appreciate all your input.
  22. $selector = "books.category=$category, limit=24"; $books = $pages->find($selector); tried that now but it also doesn't work. I kept it simple here but I'm getting just one result: echo count($books); // returns 1 and the markup is empty. My guess is it's now counting the columns with that name, not the cells within it? (and that's without even addressing the mentioned pipe-problem.)
  23. in my last post here I said fields, my bad, what I meant is column names inside a ProField table. I use $matches = $page->books("limit=24, $selector"); books being the name of the ProFields Table on this very page. The thing is, it works as long as I don't use a search term, so it looks to me as if passing the selector to the array works fine, except for where I use the pipe. The mentioned category=$category inside the selector is also referring to a column name inside the ProFields Table and I have no issue there. Either column_name~%=$q column_text~%=$q also return results but neither column_name|column_text~%=$q column_text|column_name~%=$q do. Thanks for help
  24. I now renamed the two fields name and text to something more specific but still no success. See attached what I mean by "select*", it's an option field. But there's no issue with that field, just with the two text fields mentioned and the pipe.
  25. Exactly, I get no results, not for the left nor for the right part of the pipe. column "name" of type is "Tiny Text (up to 255 chars)" column "text" is of type "Text" and column "category" is of type "Select*" The rest are no fields or columns, just additional filters passed to the server via HTML-form with get-method. Thanks for looking into this
×
×
  • Create New...