Jump to content

froot

Members
  • Posts

    720
  • Joined

  • Last visited

  • Days Won

    3

Everything posted by froot

  1. namespace ProcessWire; function myfunction() { echo $config->paths->assets; // Notice: Undefined variable: config (…) } can't access the API inside a custom function. Didn't have that problem before. This seems like a basic setting. What could be the reason?
  2. how do I return all the options of an option field? I have an option field on the children pages and need to list them. The API-documentation says as follows… $items = $fieldtypeOptions->getOptions($field); but it doesn't work. Also unclear if $fieldtypeOptions is to be used as is or would that be replaced with my field? It's not apparent if you're not a pro, the API documentation lacks examples or explanations as usual.
  3. It was a stupid typo from my side, I found out using the console. I kinda got it to work or at least use the styles I add to mystyles.js. Now I'm trying to build a uk-accordion using the styles which is not that simple after all, not to mention for the client. I added these three styles: { name: 'uk-accordion', element: 'ul', attributes: { 'uk-accordion': 'collapsible: true' } }, { name: 'uk-acc-title', element: 'a', attributes: { 'class': 'uk-accordion-title' } }, { name: 'uk-acc-content', element: 'div', attributes: { 'class': 'uk-accordion-content' } } Also very important, as you mentioned, you need to first apply the appropriate html tags to the elements you want to add the styles to, otherwise the styles won't appear. So for the <a> element I first need to make it a link with href="#" (not too complicated, I think the client can handle that). For the content no need to add a tag. And for the <ul>, you guessed it, turn it into an unordered list first. Tried that in different orders, but either way, adding the uk-accordion style to the <ul> element always puts the <a> element after or inside the <div> or turns both elements into seprate <li> elements which is not how it should be thus it doesn't work. Can you think of a way to just apply the ul-style to the list and it adds the other styles to its children accordingly? Thanks for your help.
  4. yes that describes my problem exactly. I'm using a CKEditor body inside a repeater field. I read the other threads you mentioned and the GitHub issue. Any update on this issue or should I rethink the entire approach?
  5. thanks, I knew it was possible somehow cause I've seen and done it before, works fine.
  6. I'm trying to add an uikit accordion to the styles-list of a CKEditor-body. I understand I need to add a row to the file mystyles:/site/modules/InputfieldCKEditor/mystyles.js so I tried: { name: 'Accordion', element: 'ul', attributes: { 'uk-accordion' } } and also { name: 'Accordion', element: 'ul', attributes: { 'class', 'uk-accordion' } } but both don't work. It just breaks the styles-dropdown and no styles are shown at all. I'm really not doing many changes at all, don't know how this can fail so soon in the process, haven't even got to my more sophisticated requirements, which is achieving a markup like <li> <a class="uk-accordion-title" href="#"></a> <div class="uk-accordion-content"></div> </li> inside the <ul uk-accordion> Using Mac, tried Chrome and Safari, cleared cache etc. of course. Thanks for help!
  7. I have a bilingual site. I want home to also include /en/ at the end, thus to be www.example.com/en/ (english being the default language). Is that doable?
  8. 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?
  9. 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?
  10. 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
  11. 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
  12. thanks for the quick answer and solution. I knew it had to be simple, works now.
  13. 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?
  14. 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!
  15. 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?
  16. 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.
  17. Can I automatically add the attribute target="_blank" to all links created in a CKeditor body field?
  18. @kongondo agreed, my bad, thanks so far.
  19. 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…
  20. 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
  21. @kongondo no, I mean ImportPagesCSV.
  22. 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.
  23. 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.
  24. yes, I figured, not a bug after all.
  25. 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.
×
×
  • Create New...