Skip to content

[FEATURE] resolve "ContentBlockById(...)" to key/name via right click on code? #154

@JoernBerkefeld

Description

@JoernBerkefeld

Some instances use statements like %%=ContentBlockByID("2731")=%% a lot.
That's actually considered best practice by the vendor because it cannot be "accidentally changed" like the name. Ok, same is likely true for the key but I suppose that can still be changed if one wants to.

Regardless, this presents as a problem because it makes the code unreadable and I wanted a quick way to resolve that Id and be able to open the actual content block in VSCode. Therefore we got this ticket:

it works like this:

request:

mcdev resolveId myCred/myBU asset 2463 --json

# or

mcdev rid myCred/myBU asset 2463 --json

response:

{
  "key": "35aa172d-2212-4b3d-b220-e01104394a9b",
  "name": "my super-duper cool content block",
  "path": "./retrieve/myCred/myBU/asset/block/35aa172d-2212-4b3d-b220-e01104394a9b.asset-block-meta.json"
}

See how I already added the json version for you ;-)

Alternatively, it looks like this:

mcdev rid myCred/myBU asset 2463       
11:00:32 info: mcdev:: resolveId
11:00:32 info:  - Searching asset with id 2463 on BU myCred/myBU
11:00:33 info:  - asset-block found: 35aa172d-2212-4b3d-b220-e01104394a9b (my super-duper cool content block)
11:00:33 info:  - link: ./retrieve/myCred/myBU/asset/block/35aa172d-2212-4b3d-b220-e01104394a9b.asset-block-meta.json

Metadata

Metadata

Assignees

Labels

NEWnot yet analyzed new issues get this labelenhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions