Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Nov 25 10:38
    joymon-jacob opened #1965
  • Nov 25 08:41
    hadrian625 edited #1964
  • Nov 25 08:40
    hadrian625 edited #1964
  • Nov 25 08:39
    hadrian625 edited #1964
  • Nov 25 08:39
    hadrian625 edited #1964
  • Nov 25 08:38
    hadrian625 edited #1964
  • Nov 25 08:37
    hadrian625 edited #1964
  • Nov 25 08:37
    hadrian625 opened #1964
  • Nov 23 07:55
    tidyui closed #1963
  • Nov 23 07:54
    tidyui opened #1963
  • Nov 23 07:54
    tidyui closed #1955
  • Nov 22 07:10
    mbaneryd commented #1902
  • Nov 18 16:17
    mrccarvalho opened #1962
  • Nov 16 09:23
    tidyui closed #1961
  • Nov 16 09:21
    tidyui labeled #1961
  • Nov 16 08:02
    liamkavfc opened #1961
  • Nov 15 12:40
    dnfadmin commented #1960
  • Nov 15 12:39
    dnfadmin commented #1960
  • Nov 15 12:39
    andyjwwhite opened #1960
  • Nov 15 11:59
    hadrian625 closed #1959
zedjr
@zedjr
@GangsterGeek89 Of course i can send a donation to them. I spent alot of time looking for the right cms to use. I went thru orchard, dotnetnuke, umbraco and a couple otehrs. Carefully studying waht would be best for my companies future in providing a cms to clients. I have never used a cms before so things were confusing at first and still are. I would hate for piranha to go under cause of lack of funding or interest. I just can't wait to understand piranha alto better so i can start pumping out piranha led sites. I wish i could pay for some weekend convention or something.
@GangsterGeek89 on the issue it going directly to setup.index page i am tracking down. It has been a year since i ahve used asp.net core mvc also, so some things like protocols i am rusty on.
magnuskarlssonhm
@magnuskarlssonhm
@tidyui Awsome, Thanks!
Håkan Edling
@tidyui
@zedjr_gitlab When you use the templates you get a SetupController which captures all requests to / and sends it to the setup page
@zedjr_gitlab Also, if you don’t want piranha to handle routes to the root of the application you need to disable startpage routing https://piranhacms.org/docs/master/basics/startup-options
maetiskou
@maetiskou
image.png
Hi guys.. could someone please explain to me how could it be that i cant see HTML Block here?
I'm using basically unmodified CMS Template site..
Håkan Edling
@tidyui
@maetiskou If you mean the Tiny MCE WYSIWYG editor it’s called “content” in the block list.
maetiskou
@maetiskou
@tidyui Ehm. i didn't get that.. Could you explain it a little more broadly please?
is it something i must specify in editorconfig.json or?
Håkan Edling
@tidyui
The HTML block is the one named “Content” in the screenshot you posted
maetiskou
@maetiskou

Oh. Sorry, you are right. My bad.. It's just that when using "Content" block then this text:

<div class="test">

Lorem Ipsum dolor sit amet

</div>

gets saved into DB like this:

<p>&lt;div class="test"&gt;</p>
<p>Lorem Ipsum dolor sit amet</p>
<p>&lt;/div&gt;</p>

I'll look more into this..

spacecat
@spacecat

Just bumping up my question. If anyone has done this before and would like to share how it would be really appreciated.

I've created a custom field. From within InitManager(), how can I get SiteId?

In a MVC controller I can get it like this:

public async Task<IActionResult> CategoryPage(Guid id, bool draft = false)
        {
                var categoryPage = await _loader.GetPageAsync<CategoryPage>(id, HttpContext.User, draft);
var siteId = categoryPage.SiteId;
Chris Jones
@GangsterGeek89
image.png
@spacecat If you want to get the default site id you could do something like this
But this probably wouldn't be an ideal solution if you had multiple sites. I think you may be able to set the site id for the request in the Vue component, not sure of another way you can do it through the InitManager() method though. What is it you're trying to achieve with the field?
spacecat
@spacecat
Thanks @GangsterGeek89 . We have multiple sites. The site id is needed for querying Azure Search index. So it must be unique for each site. From InitManager we need to do the following: var filterContext = await service.FilterProductsAsync(new FilterContext { SiteId = Guid.Parse("34570101-231c-4245-8a61-eb23a1561abc") }); From your example it looks like we're getting the site id for the default site? Do you have an example for how to set it in the Vue component?
Chris Jones
@GangsterGeek89
@spacecat I dont have a project setup with multiple sites I can test it works with but you should be able to grab the site id with something like this
var sId = this.$root.$data.siteId;
console.log("Site Id:" + sId);
Chris Jones
@GangsterGeek89
@spacecat just managed to have a quick test with a multitenancy setup and seems this will get you the site id for the page/post the field belongs too
Håkan Edling
@tidyui
@spacecat As you can’t inject the full page/post model into the field Init events have you tried the hooks for loading/saving models. In OnLoad you have access to the entire model. https://piranhacms.org/docs/master/application/hooks
Chris Jones
@GangsterGeek89
@tidyui I have defined a 'ContentGroup' and a 'content type' to go in that group. I can get blocks to work in the content type but can't figure out if there is a way to restrict which blocks can be used. Is there a way of doing it?
i tried doing it the same way as a block-group but didn't seem to work
spacecat
@spacecat
@tidyui are you referring to App.Hooks.Pages.RegisterOnLoad((page) => { ... });?
Håkan Edling
@tidyui
@spacecat Yes!
spacecat
@spacecat

Hi, is it possible to use System.Text.Json instead of Newtonsoft.Json for my Query property for my Vue Query Builder custom field?

It works when using Newtonsoft.Json.Linq.JObject but not when I try with System.Text.Json.Nodes.JsonObject or any of the other System.Text.Json apis. Any ideas?

[FieldType(Name = "Vue Query Builder Field", Component = "vue-query-builder-field")]
public class VueQueryBuilderField : IField
{
    public IList<VueQueryBuilderRule> Rules { get; set; }
    public JObject Query { get; set; } = new JObject(); // Works
    // public JsonObject Query { get; set; } = new JsonObject(); // Does not work

    public string GetTitle()
    {
        return "Vue Query Builder Field";
    }

    public async Task InitManager(.........
Håkan Edling
@tidyui
@spacecat Piranha configures the application to use Newtonsoft as the manager is dependent on certain features that are not available in System.Text.JSON
spacecat
@spacecat
Thanks @tidyui . So I guess it's best to stick with Newtonsoft then when adding/extending functionality in /manager?
Håkan Edling
@tidyui
@spacecat Yes! If would manage to exchange Newtonsoft in your application you would most likely end up breaking the entire manager interface!
spacecat
@spacecat
@tidyui OK! Thanks!
tashe
@tashe

I'm looking at scheduling a page publish in v10. I can't find much documentation about how it's implemented. I did some tests and looks like you can schedule a new page to be published at a future date by changing the Published data for the page to be in the future.

But when it comes to an already existing page and scheduling a change in the same way, the change is saved as a draft but it's never published even when the Published date becomes current.

Are my observations correct and is this by design?

Furkan Tokmak
@FurkanTokmak
Hi. I am making a web app that has SEO. I am currently using piranhaCMS for my content and I use razor pages for rendering. I want to use frontend frameworks with server side rendering In my future projects. And I think that means I need to get my data through piranhaWebApi ? Is this possible? Does that makes sense ? I am fairly new and I am not sure if my question makes sense but I would be glad if someone can clarify thanks!
admzvk
@admzvk
Hello, I would like to create tiniest possible ECommerce module for Piranha. Is there any tutorial, or doccumentation which will help me how to do it? I am now studying piranha source code, but it is quite slow approach and i am not sure, if my approaches are right. If there is not such a thing, would you find it useful if I will write something like that during my developement?
Håkan Edling
@tidyui
@admzvk There are so many approaches to doing what you’re talking about. Are you planning on using the built in content models or are you adding your own database structure and management pages for it? There’s also the possibility to integrate Piranha with one of the existing platforms for .NET Core, for example NopCommerce if you need a fully fledged commerce system
spacecat
@spacecat
@tidyui can you explain what the "Languages" dialog does and what it's used for? And what the "Default" setting does when setting it for one of the languages in the "Languages" list? (The same dialog)
Håkan Edling
@tidyui
@spacecat Piranha doesn't support multiple languages in the sense that a page or post can be in only one language, but it supports language in the sense that you can create multiple sites and create different languages with different culture settings that you assign to them. If you then create generic content types (i.e. Content<T>) these can be translated as the purpose with these content objects is that they should be reusable between different sites (which could use different languages).
tobylo
@tobylo:matrix.org
[m]

@tidyui: trying to add a DataSelectField to a block and was wondering if there's any way in the static GetList method to get a hold of the current context where the field is being used?

E.g. when adding a block, containing a DataSelectField, to a page, I'd like to get a hold of properties on that page to filter on the possible values fetched.

Håkan Edling
@tidyui
@tobylo client-side in the manager UI or server-side?
tobylo
@tobylo:matrix.org
[m]
server-side when GetList is being called on the DataSelectField<T> type
Håkan Edling
@tidyui
@tobylo:matrix.org The init mechanism doesn't know the model context when performing initialization on field level. I think you should add an issue/feature request for it at the GitHub repo. Just remember that even if this support existed, the first time the model was initialized (for a new model) all property values would be empty on the model and no filtering could be applied anyway. As the functionality would be server-side the filtering wouldn't take affect until the model was saved and reloaded into the UI.
tobylo
@tobylo:matrix.org
[m]
did a workaround for now, rather brittle due to using a scoped httpcontextaccessor and relying on RouteValues and/or referer header + path structure, but does the job.
Constantinos Leftheris
@cleftheris
Hi all I am wondering if there is a way to build a nested structure of more than 2 levels. I am looking to drive a 3 level megamenu out of this. Can I have ArchivePages of ArchivePosts or Posts or something similar. What am I missing in regards to hierarchies? Thanks
richardaubin
@richardaubin
Is anyone using Piranha with blazor in any way?
Benjamín Camacho
@jahbenjah
Hi , I'm trying to return a webmanifest file with Piranha CMS
in a regular asp.net core app with this code it works but I can make it Work with Piranha
var app = builder.Build();
var fileExtensionContentTypeProvider = new FileExtensionContentTypeProvider();
fileExtensionContentTypeProvider.Mappings[".webmanifest"] = "application/manifest+json";
app.UseStaticFiles(new StaticFileOptions()
{
ContentTypeProvider = fileExtensionContentTypeProvider
});
dblood2
@dblood2
@richardaubin - Not yet, but I'm hoping to give it a shot sometime soon. Made the switch to Blazor about 8 months ago and SO much happier. If you beat me to it, please post results.
Hai Nguyen
@hainguyen0011
Good morning, I got an issue about localization with piranhaCMS I had posted in issue #1953 PiranhaCMS/piranha.core#1953
I need your help to know how localization in piranhaCMS work :( please help me
I really really appreciate you guys
Hai Nguyen
@hainguyen0011
I know that 4 years ago have an issue about localization but for now I dont know if piranha have any update about localization or not. sorry if I am annoying
Furkan Tokmak
@FurkanTokmak
Hello all, Does anyone know what might be causing this. Happens on page save.
image.png