Jump to content

clsource

Members
  • Content Count

    359
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by clsource

  1. Thanks this is a nice improvement πŸ™‚ Now it's lazy loaded and the thumbnails are 200x200 px πŸ™‚
  2. https://processwire.com/api/ref/languages/get-default/ $wire->addHookBefore("Pages::saveReady", function(HookEvent $event) { $page = $event->arguments(0); if($page->template->name != 'mytemplate') return; if(count(wire("languages")) > 1) { $defaultLang = wire("languages")->getDefault(); $page->title->setLanguageValue($defaultLang, "New Value"); } else { $page->title = "New value"; } $event->arguments(0, $page); });
  3. May be this can work? https://processwire.com/api/ref/pages-type/save-ready/ $wire->addHookBefore("Pages::saveReady", function(HookEvent $event) { $page = $event->arguments(0); if($page->template->name != 'mytemplate') return; $defaultLang = wire("languages")->get("default"); $page->title->setLanguageValue($defaultLang, "New Value"); $event->arguments(0, $page); });
  4. $defaultLang = wire("languages")->get("default"); $page->title->setLanguageValue($defaultLang, "New Value");
  5. Maybe is your internet provider configuration. https://watchmysys.com/blog/2015/01/unitymedia-is-blocking-vpn-connections/ Please try using another Internet provider maybe using 4G. Or similar network. Thanks.
  6. check if you are using https πŸ™‚ https://aves.ninjas.cl/
  7. Hello, I finished this toy project. A simple API to show data for Chilean Birds. Used to flex my PW and React muscles, since a lot of time has passed since making something with those techs. Code: https://github.com/NinjasCL/chileanbirds-api Frontend (React): https://aves.ninjas.cl Backend (PW): https://aves.ninjas.cl/api Hope you like it πŸ™‚ Thanks.
  8. clsource

    Solidwire Language

    I didnΒ΄t mean to say which approach is better. I think RockMigrations is a good tool. SolidWire is not a replacement of any migration strategy or tool. It's just an idea to ease the communication and prototyping between developers and other people. It's in the same area of https://plantuml.com/ Just a tool to improving an eagle view of the system. The JSON output is just an idea similar to https://doc.mapeditor.org/en/stable/manual/introduction/ Any other proper migration tool could use it to generate a proper output. But is not mandatory :).
  9. clsource

    Solidwire Language

    Ok I have been toying around with this lib https://mudgen.github.io/webscript/docs/ And make a somewhat implementation of SolidWire using Javascript. import builder from "webscript/src/webscript.js"; import createElement from "webscript/src/createObjectElement.js"; const { wire, templates, template, fields, field, pages, page } = builder( createElement ); const core = { fields: { textarea: field.class("FieldtypeTextarea"), }, }; const site = {}; site.fields = { body: core.fields.textarea.name("body"), about: core.fields.textarea.name("about").max(100), }; site.templates = { home: template .name("home") .root(true) .fields(site.fields.body.label("Content")(), site.fields.about()), }; site.pages = { home: page.title("Home").template(site.templates.home()), }; const render = (data) => Object.values(data).map((item) => item()); const solid = wire( templates(render(site.templates)), fields(render(site.fields)), pages(render(site.pages)) ); console.log(JSON.stringify(solid, null, 2)); executing that code brings this result in json { "tagName": "wire", "children": [ { "tagName": "templates", "children": [ { "tagName": "template", "children": [], "value": "", "__isElement": true, "name": "home", "root": true, "fields": [ { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "body", "label": "Content" }, { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "about", "max": 100 } ] } ], "value": "", "__isElement": true }, { "tagName": "fields", "children": [ { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "body" }, { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "about", "max": 100 } ], "value": "", "__isElement": true }, { "tagName": "pages", "children": [ { "tagName": "page", "children": [], "value": "", "__isElement": true, "title": "Home", "template": { "tagName": "template", "children": [], "value": "", "__isElement": true, "name": "home", "root": true, "fields": [ { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "body", "label": "Content" }, { "tagName": "field", "children": [], "value": "", "__isElement": true, "class": "FieldtypeTextarea", "name": "about", "max": 100 } ] } } ], "value": "", "__isElement": true } ], "value": "", "__isElement": true } @bernhard maybe some JSON like that could be used in RockMigrations. So you have the best of both worlds. A simpler syntax and an output that could be used to define migrations using JSON πŸ™‚
  10. Althought Laragon is a great choice. You can also use Docker if you want πŸ™‚ Here I made a simple config for PW https://github.com/joyofpw/docker πŸ™‚
  11. clsource

    Solidwire Language

    Hey I updated the spec. Now it's more like Pseudocode than a whole language in itself. The idea is just to communicate better and make plans before building or thinkering with the fields. Example for this small project that I'm building https://github.com/NinjasCL/chileanbirds-api @document { @wire { @templates { home: template().options({@once, @strong, @root}), notfound: template().options({@once, @childless}).description("Used in 404 errors"), birds: template().options({@strong}).family({ parents: ["home"], children: ["birds-item"] }), birds-item: template().options({@childless}).family({ parents: ["birds"] }) }, @fields { title: text().options({@i18n, @global}), body: textarea().options({@i18n}), uid: text(), href: url(), file: files().max(1), migration: checkbox(), dimorfism: checkbox(), size: text(), order: text(), species: text(), image: images().max(1).mediatypes([@jpg, @png, @svg]), images: images().mediatypes([@jpg, @png, @svg]), value: text().options({@i18n}), habitat: textarea() .description("Stores the habitat property") .options({@i18n}), didyouknow: textarea() .description("Stores the did you know property") .options({@i18n}), iucn: pagetable() .max(1) .fields({ body: body().description("Stores the iucn description"), value: value().description("Stores the iucn value") }), audio: pagetable() .max(1) .fields({ file, title.label("Author") }), map: pagetable() .max(1) .fields({ image, value }), }, @pages { + "Home" (template:home) @many -> { + "Birds" (template:birds) @many -> { + "Bird 1" (template:birds-item, fields: { title: title().label("Names"), body: body().label("Description").description("Stores the bird description"), images, habitat, didyouknow, iucn, audio, map, species, migration, dimorfism }) } // /birds } // /home } // /pages } // /wire } // /document
  12. I think another approach is just having a "Homily" template.That uses a repeater field to storage dates and seasons. Maybe a structure similar to this <homilies> <homily> <title /> <about /> <repeater> <priority type="int"/> <date/> <season /> </repeater> </homily> <homily> <title /> <about /> <repeater> <priority type="int"/> <date/> <season /> </repeater> </homily> <homily> <title /> <about /> <repeater> <priority type="int"/> <date/> <season /> </repeater> </homily> </homilies> So you can search all the homilies and put the different dates and season configuration for that homily. If one or more homily is on the same date then you can use the priority field to sort them out.
  13. Also you can use this docker file I created for easy PW dev env πŸ™‚ https://github.com/joyofpw/docker
  14. This is a cool idea. I will start creating a course, but it has no the contents, but in the following weeks I will start uploading videos.
  15. Hello friends here a small config for quickly using composer and processwire https://github.com/joyofpw/docker πŸ˜„
  16. clsource

    Merry Christmas

    Happy Holidays to All! $log->save("πŸŽ„πŸŽ…");
  17. Hello, Normally ProcessWire api does not change at all. Personally I think is one of the most stable apis I have met in a software product. So any new version contains either a bug fix or a new feature, but not a change in how things are used. So if you want a detailed changelog mostly it would be bug fixes and new features. In my opinion is not needed since the documentation, blog posts and commits in the dev branch are enough for a detailed overview of whats new and fixed. And the forums are a great way of obtaining info about the hidden gems of the API. though, I do not know if a CHANGELOG.md file really exists. Hope it helps πŸ™‚
  18. Seems like a cool and smart son. I currently do not have any C64. But maybe if he likes chiptune music these projects with arduino could help https://github.com/stg/Squawk https://github.com/blakelivingston/DuinoTune And this tracker for gameboys https://www.littlesounddj.com/lsd/index.php πŸ™‚
  19. clsource

    Solidwire Language

    Well is true that non technical clients could have some trouble understanding this language. But I believe they often have a technical counter part that could understand this. Though tools that generate documentation pages and maybe even migrations scripts?. would be cool to have πŸ˜›
  20. clsource

    Solidwire Language

    Hello Robin, Is not meant to be a programming language. Is more like a prototyping language. maybe in the future tools can be written to generate files or similar. The objective is to create a document that can show pages, templates and fields relationships in a eagle view fashion. Before you start creating the templates in PW you can prototype in this document like a scratch pad to clear ideas and see different options before investing time in programming.
  21. clsource

    Solidwire Language

    Hello friends, I participated in a project that needed lots of relationships between fields and pages. and I struggled on how to arquitech such complex scenario. So I figure out and documented this little idea. A CSS like language for data relationships. https://github.com/joyofpw/solidwire Hope you find it useful and all ideas and contributions are welcome πŸ˜„ Thanks.
  22. Hello you can use the translation module to create a page for users to translate https://processwire.com/api/multi-language-support/code-i18n/ πŸ™‚
  23. Its easy to integrate ProcessWire if the systems you are using are compatible with composer. So you can for example save information in ProcessWire and all the cart logic could be delegated to woocommerce, opencart, prestashop, etc. $ composer require processwire/processwire Then on your phps something similar to this use \ProcessWire as Pw; $pw = new Pw(); $pw->config->dbHost = getenv('MYSQL_HOST'); $pw->config->dbName = getenv('MYSQL_DATABASE'); $pw->config->dbUser = getenv('MYSQL_USER'); $pw->config->dbPass = getenv('MYSQL_PASS'); $pw->config->dbPort = getenv('MYSQL_PORT'); $pw->config->dbCharset = 'utf8mb4'; $pw->config->dbEngine = 'InnoDB'; $pages = $pw->pages;
  24. Padloper is the one. But you can always integrate PW with other systems based on PHP. Just a composer command away πŸ™‚
Γ—
Γ—
  • Create New...