Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 11:52
    tidyui closed #998
  • 11:52
    tidyui commented #998
  • 11:52
    tidyui labeled #998
  • 11:37
    haidersafaa opened #998
  • 10:04
    tidyui closed #997
  • 10:04
    tidyui assigned #997
  • 10:04
    tidyui milestoned #997
  • 10:04
    tidyui labeled #997
  • 10:04
    tidyui labeled #997
  • 09:46
    psandgren review_requested #997
  • 09:45
    psandgren opened #997
  • 07:06
    tidyui assigned #972
  • Jan 18 20:54
    tidyui closed #996
  • Jan 18 20:54
    tidyui opened #996
  • Jan 18 20:54
    tidyui closed #995
  • Jan 18 15:04
    tidyui opened #995
  • Jan 18 15:03
    tidyui assigned #888
  • Jan 18 15:00
    tidyui unassigned #867
  • Jan 18 15:00
    tidyui closed #186
  • Jan 18 14:58
    tidyui closed #992
Jon
@jonaldo_gitlab
So the question is, is it possible to inherit from BlockGroup, but do not show the option to have child items? Thanks again in advance - I think I'll be blogging about all this when I have done our first Piranha site with all this information :)
Håkan Edling
@tidyui
Hi! Generic display for blocks are scheduled for the next release (8.1) PiranhaCMS/piranha.core#820
The core functionality of a BlockGroup is to have items so there’s no way to disable it in that way. However, since your four fields are very simple ones, writing a component for it is straightforward, and with any luck 8.1 will be out before you start on the next 😁
Jon
@jonaldo_gitlab
Fantastic, thanks @tidyui that looks exactly what we'd want :) we've got a couple of months before we start migrating our website anyway. We could continue to use the BlockGroup as a prototype for now, it's just slightly 'odd looking'. Do you have any rough idea when it could be available at all? I don't want to be cheeky :) got to say though you've done a superb job on Piranha and just finding loads of little nice features in it everyday
Clockfoot
@Clockfoot
Hello. I have a perhaps stupid question. When I make a custom block with two fields in Piranha, I cannot seem to get the second field to show up in the manager when I am editing a page. I tried to modify the Vue import js file by adding another contenteditable <p> tag and a second (renamed) onBlur function. I have searched everywhere to for clues. Does anyone know what I am missing?
Håkan Edling
@tidyui
Yes! Vue.js only allows one root node per component! Put those two p tags inside a div and it should work!
MarcoDonkers
@MarcoDonkers
@tidyui "We are adding the hook we discussed in version 8.1 to extend the default sitemap generation", sick! I will just wait for the 8.1 release then.
Clockfoot
@Clockfoot
Wov! Thankyou it actually worked to put the Vue p tags inside a second wrapper div! You made my day (night)
EsmaeelZekaee
@EsmaeelZekaee
Hello, I want to add a new page to CMS to show event about art galleries for visitors be able to create an account and send their resume to me and after verification, I'll invite them to the gallery.
so I need an admin page to manage events (create an event, download resume, send email to users ...)
I need help with how to start create a plugin for PiranhaCMS.
Håkan Edling
@tidyui
For starters I think you should create a special Archive for your events and a special PostType for your events. By using the standard archive functionality you get categorization and tagging for your events out of the box.

For users you should add the custom claims and policies you need in your application and make them assignable from the manager. This way you can create users and when accepted assign them the correct permissions for viewing the logged in pages. The documentation here is bit lacking, but a good way is to take a look at how the WebApi module adds its custom claims and policies and makes them assignable from within the manager.

https://github.com/PiranhaCMS/piranha.core/blob/master/core/Piranha.WebApi/Module.cs#L85
https://github.com/PiranhaCMS/piranha.core/blob/master/core/Piranha.WebApi/WebApiModuleExtensions.cs#L40

EsmaeelZekaee
@EsmaeelZekaee
Thank you, you mean I should create a special Archive or Page?
EsmaeelZekaee
@EsmaeelZekaee
I got it, Archive is a special page with IsArchive=True ??
Håkan Edling
@tidyui
Yes!
Patrick Klaeren
@Inzanit
Trying to make my own block group (and blocks), but require multiple image/media picker fields. Is this something that is supported in custom components as it seems the media picker is handled internally by Piranha and I have no way of registering different functions for the two distinct media pickers.
Håkan Edling
@tidyui
There shouldn't be an issue with having several ImageField properties in the same block, this is fully supported in Regions. What problems are you experiencing
Each ImageField is registered by a self-contained component and handles events from the media picker modal.
But you can't have several media pickers open at the same time in the UI
Andrey Ushakov
@gyfke
Hello. I noticed that HookManager.OnGenerateSlug is readonly now and cannot be initialized
Jon
@jonaldo_gitlab
Hi @tidyui I've got a question about saving and publishing. I created a page with a URL /test and added a block with just "v1" on it. I clicked on "Save" and I could see in a different browser that the page was visible. I was expecting that it would 404 as I had not published it. I was expecting that as it was a 'draft' page it would not be available until I clicked 'Publish'. I clicked 'Publish' and I could see the page as expected. But when I clicked 'Unpublish' the page was still visible! Any help would be really appreciated!
Håkan Edling
@tidyui
Thanks @gyfke We just accepted a huge PR and tried to go through each changed file, but it’s easy to miss these small details!
Patrick Klaeren
@Inzanit
I cannot change the Select (or other) methods for the multiple media pickers, i.e. I cannot determine which media picker has just been used in the Vue.js component.
Andrey Ushakov
@gyfke
Hi @tidyui
I have a suggestion about slight improvement of multi-lingual support. For now the only way to have content in multiple language is creating multiple sites. It's perfectly acceptable in my case, but still there are some shared code and resources which are used by all sites. And to keep consistent urls I would like to know requested hostname.
I.e. I have pages:
example.com/articles
example.com/en/articles
which are just list of articles and doesn't require different .cshtml-files. Lists of articles are site-specific though. And I need requested hostname to add proper link to article.
So that example.com/articles will have link to example.com/articles/some-article. And examle.com/en/articles will have link to example.com/en/articles/some-other-article.
Can we keep requested hostname since the original is rewritten in ApplicationMiddleware?

I'm not sure is it ok to create PR for changes without opened issue or it's better to discuss here first?
Commit is in [my fork](https://github.com/gyfke/piranha.core/commit/8551ac9799f20b64b1bafd287d4855e962ddf0e0)
sorry for formatting, can't deal with the markdown :-)
Håkan Edling
@tidyui
Hi there @gyfke You can send a PR with your additions, it sounds like a good idea, especially since we already store the original Url requested before it's rewritten in the middleware!
However I would probably have put the requested hostname in the IApplicationService instead of the ISiteHelper as that's where the Url is stored. And the site helper is more intended to hold state about the current site requested.
Håkan Edling
@tidyui
Hi @jonaldo_gitlab This seems to be an issue related to the upgrade to .NET Core 3.1. As authentication/authorization is implemented differently the middleware can't check access (which it did previously). I'll add an issue for this at GitHub and we'll move this into the IModelLoader. For now I suggest you add a check after loading the model in your controller/page.
if (!model.Published.HasValue || model.Published.Value > DateTime.Now)
{
    // return a 404
}
See this issue for reference #985
Håkan Edling
@tidyui
@gyfke SlugGeneration hook issue resolved. See here for reference PiranhaCMS/piranha.core@740b63e
Håkan Edling
@tidyui
@jonaldo_gitlab The issue seems to be in the IntegratedMiddleware which caches the current page/post even though it's not published. The ModelLoader then returns the cached instance.
Håkan Edling
@tidyui
@jonaldo_gitlab I have resolved this issue in master. See PiranhaCMS/piranha.core@6a31669 for reference
Jon
@jonaldo_gitlab
@tidyui - thank you so much for that, really appreciate it!
Norbert Haberl
@nhaberl
I have an existing ready2use API project where I need a small CMS for the UI part. I would like to have the possibility to add some configurations on runtime for several pages. Is PiranhaCMS the way to go ?
If yes, are there any samples how integrate Piranha to an existing ASP.NET Core API project ?!
Håkan Edling
@tidyui
Hi there @nhaberl It's easy to add Piranha to an existing application! Check the docs for Getting Started here http://piranhacms.org/docs/basics/getting-started Basically, in ConfigureServices you setup the application with the components you want, and in Configure you enabled the middleware (routing) you want. This means you can include just the manager and no application routing if you just want your users to edit content that you use in your static pages.
Zahir Mahmud
@mahmudmihon
How can I open a piranha blog project in visual studio 2019?
Zahir Mahmud
@mahmudmihon
@tidyui
Håkan Edling
@tidyui
You create the project from command line as written in the docs and then open in VS!
Zahir Mahmud
@mahmudmihon
@tidyui for building client applications with the ASP.NET core which nuget package I should use?
Håkan Edling
@tidyui
All project templates package. Take a look here for instructions http://piranhacms.org/docs/basics/project-templates
Zahir Mahmud
@mahmudmihon
@tidyui after running dotnet restore I am getting following error
Failed to download package 'SQLitePCLRaw.core.2.0.2' from 'https://api.nuget.org/v3-flatcontainer/sqlitepclraw.core/2.0.2/sqlitepclraw.core.2.0.2.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/sqlitepclraw.core/2.0.2/sqlitepclraw.core.2.0.2.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Failed to download package 'SixLabors.ImageSharp.1.0.0-beta0007' from 'https://api.nuget.org/v3-flatcontainer/sixlabors.imagesharp/1.0.0-beta0007/sixlabors.imagesharp.1.0.0-beta0007.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/sixlabors.imagesharp/1.0.0-beta0007/sixlabors.imagesharp.1.0.0-beta0007.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Failed to download package 'AutoMapper.9.0.0' from 'https://api.nuget.org/v3-flatcontainer/automapper/9.0.0/automapper.9.0.0.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/automapper/9.0.0/automapper.9.0.0.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Failed to download package 'SQLitePCLRaw.provider.dynamic_cdecl.2.0.2' from 'https://api.nuget.org/v3-flatcontainer/sqlitepclraw.provider.dynamic_cdecl/2.0.2/sqlitepclraw.provider.dynamic_cdecl.2.0.2.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/sqlitepclraw.provider.dynamic_cdecl/2.0.2/sqlitepclraw.provider.dynamic_cdecl.2.0.2.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Failed to download package 'Microsoft.EntityFrameworkCore.3.1.0' from 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/3.1.0/microsoft.entityframeworkcore.3.1.0.nupkg'.
The download of 'https://api.nuget.org/v3-flatcontainer/microsoft.entityframeworkcore/3.1.0/microsoft.entityframeworkcore.3.1.0.nupkg' timed out because no data was received for 60000ms.
Exception of type 'System.TimeoutException' was thrown.
Jon
@jonaldo_gitlab
Sounds like you have network errors @mahmudmihon
Håkan Edling
@tidyui
The message clearly indicates network issues at your or nugets end. Try to restore again!
Norbert Haberl
@nhaberl
@tidyui thanks but I really struggle with what midddleware here is doing what in which order. I simply want that alle routes from a specific route are not handled by piranha but instead by my project.
Just a suggestion but I think every developer would benefit of a short request pipeline flow chart in the docs with some notes added. 🤗
Håkan Edling
@tidyui
@nhaberl Yes the docs are an area of continuous improvement 😁 But basically, piranha doesn’t “handle” anything, it only rewrites requests and lets asp.net handle it. This means that if you request a permalink that doesn’t exist it should just be passed on to your application
This also means that you cant have static application routes position “below” a dynamic piranha page. For example if you have a page with the permalink “products” you can’t have a static route with “products/view/{id}”
The middleware routing will assume “view/{id}” are additional parameters you want to pass on to the products page