question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

GenericBlock not updating item title in the manager

See original GitHub issue

Hi,

not sure if its a bug or I am doing it wrong, but using the code below, the title doesnt show up in the item list until a page refresh, It could be onblur setting in vue? According to the docs: “No specific Vue component is needed to render block groups”.

The same thing happens with a region as well, region i have:

using Piranha.Extend;
using Piranha.Extend.Blocks;
using Piranha.Extend.Fields;

[BlockGroupType(Name = "PDFFiles", Category = "Media", Icon = "fas fa-images")]
[BlockItemType(Type = typeof(AuthorBlock))]
public class MyBlockGroup : BlockGroup
{

}


[BlockType(Name = "Author", Category = "Media", Icon = "fas fa-fish")]
public class AuthorBlock : Block
{
    public StringField Title { get; set; }

    public HtmlField HtmlField { get; set; }

    public MediaField PdfFile { get; set; }

    public ImageField Image { get; set; }


    public override string GetTitle()
    {
        return Title;
    }
}

image

    [Region(ListTitle = "Title", ListExpand = false)]
    public IList<MyRegion> PDFFiles { get; set; }

image

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
tidyuicommented, Jun 24, 2020

@mikaellindemann That worked perfectly. So in other words when setting the ListTitle property of the BlockTypeAttribute, overriding Block.GetTitle() is not necessary.

0reactions
tidyuicommented, Jun 24, 2020

@mikaellindemann The class Piranha.Extend.Block currently has the default implementation:

public virtual string GetTitle()
{
    return "[Not Implemented]";
}

This implementation could be expanded to check if ListTitle is set, and if it is return the title for the specified field. If ListTitle are empty the current string “[Not Implemented]” could be returned. And for all blocks overriding this method it wouldn’t make any difference.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Sheet Set Title Block Fields not updating...?
Solved: I'm pretty unfamiliar with Sheet Sets and am trying to set up a title block (eventually a template) that will automate the...
Read more >
Title Block & Rev Block not updating when processing ...
I have everything set up and drawings/parts can be sent through the workflow, however the title block and rev blocks aren't updating completely....
Read more >
Update
See the history of all updates to the Land F/X plugins for AutoCAD, including a description of the new features and fixes added...
Read more >
Xcode TabBarItem Title not updating properly
I set the title of the two tab bar items via the attributes inspector and it worked fine on both view controllers.
Read more >
class BlockContentBlock - Drupal 10.1
Defines a generic block type. ... Indicates the block label (title) should be displayed to end users. ... Formats a string containing a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found