Jump to content

diogo

Moderators
  • Posts

    4,261
  • Joined

  • Last visited

  • Days Won

    75

Everything posted by diogo

  1. Moderator note: @ngrmm I understand that this thread is aimed at German speaking developers, but to keep the moderation manageable, we only allow English in the forum. Could you please edit the content of your post to be in English?
  2. You can also use the selector with the children() method: $page->children("children.count=0, sort=-date");
  3. This is exactly what creates the upgrading problem that Ryan is trying to avoid, since data is in HTML already in all processwire installs.
  4. Usually I set the font size in the html or body tags, and then use rem for pretty much everything else. I use em in the rare occasions that the size of an element should definitely dependent on the size of the parent, but usually I want the flexibility to control them independently of each other with rem. When you use em on everything, it's very easy to overlook small differences between the text inside elements and you end up having the same kind of text set in 11.5px and 12px in different places, for instance. As for the base size itself, it depends a lot on the layout. Some layouts account for large screens, and divide into multiple columns. On those cases the base font can usually stay the same though any screen size, and can be set in pixels or em. On more static layouts I normally want the font to grow a bit with the screen width, but not too much (I mean, not proportionally. I want it to grow less and less as the screen becomes larger). For that I use a calc() to create a relation between the vw and the pixels. For instance: font-size: calc(8px + .7vw); And I usually want to define a minimum and a maximum sizes. This can be done with media queries, or simply by using the clamp function: font-size: clamp(15px, calc(8px + .7vw), 20px); This defines that the font grows with the screen width but never becomes smaller than 15px or larger than 20px.
  5. Hm, for indexing, I would assume that's worse, since google would see it as a bunch of different documents. Also, I'm not sure about how efficient it would be to have pdf.js running individually for each page. I think you should separate indexing and viewing in two issues: show the pdf in a viewer, and link to it directly for indexing. I only checked pdf.js superficially, but I have the feeling that you could use it's api and css to control it as you wish. See this example from their page: https://jsfiddle.net/pdfjs/wagvs9Lf/, For what I've seen, you can also control zoom, and so on... Have a look at this video on how to build a PDF viewer with it. Maybe this is overkill for your project, but it's interesting for sure ?
  6. If you don't need specifically an imitation of a magazine, there might be other solutions. That one might be a good idea ? Did you see pdf.js from Mozilla?
  7. That's a tricky one. At least I didn't find anything like this some months ago. What about using something like Turnjs , which is for html5 content, not pdf, but use imagemagick to convert the PDFs to PNGs?
  8. if the DocumentRoot is now set to /var/www/html/pwire, there's no need to set the RewriteBase to the subdirectory anymore. Either leave them all commented, or uncomment only the first one: "RewriteBase /"
  9. Just want to point out that you can also do this with the new URL hooks https://processwire.com/blog/posts/pw-3.0.173/#introducing-url-path-hooks I can't test it now, but something like this should work (not tested!): $wire->addHook('/{building}', function($event) { $name = $event->sanitizer->pageName($event->arguments("building")); $building = $event->pages->findOne("parent=/buildings/, name=$name"); if($building->viewable()) return $building; });
  10. You're welcome ✌️ Svelte is also a great introduction to component based development, and the tutorial is great. React is a bit overwhelming at first because it feels so clunky, but it brings more job opportunities with it. If you still want to learn React after learning Svelte, at least you'll have already some of the shared concepts grasped.
  11. If you want to do something quickly, maybe gatsby is not ideal. Have a look at https://kit.svelte.dev/ or https://www.11ty.dev/. Those are two easy ones for creating static sites, and I would encourage you to have a look at them (particularly Svelte and SvelteKit) so you see what's new in the craft, but I'm sure you would find it as easy to get back on PW since there was no complexity added at all.
  12. I was curious about this, and did a quick search to see what there is besides Dailymotion. Only found two promising platforms, interestingly both from the Balkans: https://bunny.net/ from Slovenia and https://publit.io/ from Serbia.
  13. Dailymotion is French, you could give it a try.
  14. diogo

    Alpine.js help

    @jploch there's an error in your json. Close to the end: } } } }], "breakpointActive": "base", should be: } } }], "breakpointActive": "base",
  15. I don't work with webflow, but I don't think you can call an API from the webflow server. You could probably call it from AJAX, but that wouldn't make much sense for the whole website. It seems to me that you have two options: Build the site in webflow and export the html to use in ProcessWire, or use their API to sync data between ProcessWire and their CMS. Honestly, both options seem expensive to me, since you won't be taking full advantage of the system.
  16. You can add a get parameter to the url on the ajax request, and strip the header and footer based with that (ex: ?content=modal), like you mentioned for the iframe. It solves the problem easily, and I don't think it's not elegant, just explicit.
  17. @bernhard Sorry, you're right! I failed to see this small detail id>0 ? Edited my post.
  18. ...just be aware that it might not be as simple as that. Those techniques will set the title on page creation. If the editor decides to modify those fields, the title won't be updated. You might have to account for that with a hook that listens to those fields being modified also. Conclusion: keep it simple if you can, and do these only if you absolutely think it's better not to have the title.
  19. I have a different opinion from @cryostar here. If you need this content to be easily searched, I would say it's better to keep the pages. As for the title, that link is a good read and there are other possible approaches, particularly with the use of hooks (don't have time to go through them now), but consider renaming the title field to "identifier" in those templates and leave it at that. This will greatly simplify your coding and will give editors a chance to add words that are not in the question but might be useful for searching later, it will also keep things tighter and more readable in the pages tree.
  20. It shouldn't be a problem to access that image directly, that's exactly what happens with the css and js files that you add in the templates folder. It could be a permissions problem in the server, but then you wouldn't have that 404 page. May seem too obvious, but make sure that you wrote the url correctly ?
  21. Hi Siddhi, welcome to the forum. That has more to do with the comments system than Processwire. You have to identify what is their strategy to refer to individual blog posts from a listing page. Your snippet of code doesn't give much away, all I can infer is that vuukle will use the url of the page to identify the post. So, I'm guessing they must have a strategy for listing pages where you pass the url of each post in the list to an attribute on that span (something like data-vuukle-url. Just guessing...). You'll need to see that in their documentation and then we can help you with implementing it in Processwire. Maybe someone in the forum has used this system before and can help you better.
  22. One way is to tell them to have the Hannacodes side by side, just like the buttons would be [[special_button url='example1.com' label='Visit Example1.com']][[special_button url='example2.com' label='Visit Example2.com']] But this depends on the html code that you are generating for that Hanna code. For that to work, you would need the root html tag of each of those buttons to be displayed as "inline-block" on your CSS. Another option is to use a single Hanna Code for both buttons, and style them to be side by side. This would give you more control over the styling, since you can have a parent tag around the two buttons. [[special_button url='example1.com' label='Visit Example1.com' url2='example2.com' label2='Visit Example2.com']] This could be the same Hanna code for single and double buttons. If the url2 is not given, show a single button, if it is given, create the second button. A shorter alternative might be: [[special_button url='example1.com|example2.com' label='Visit Example1.com|Visit Example2.com']] For this you would have to explode() the value of "url" and "label" by the "|" separator, and create one button for each value in the resulting array.
  23. @adrian I think the problem here might the wrong format importing (the separator precisely) and not the widths themselves. @Norman_12 Your question shows that you don't have an understanding of how a csv file works. Please have a look here https://support.microsoft.com/en-us/office/import-or-export-text-txt-or-csv-files-5250ac4c-663c-47ce-937b-339e391393ba. This is not related with Processwire at all. I don't know if you're a new web developer or the owner of the website doing some DIY, and I'm personally fine with any of those, but be aware that we're a bunch of seasoned developers offering you some valuable time, and we'll need to draw a limit somewhere.
  24. In "CSV fields separated with" you must must add the character that you want as the csv separator. That would usually be a comma "," or a semicolon ";"
×
×
  • Create New...