Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
JoernBerkefeld opened this issue Mar 25, 2024 · 1 comment
Labels
enhancement New feature or request NEW not yet analyzed new issues get this label

Comments

@JoernBerkefeld
Copy link
Contributor

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
@JoernBerkefeld JoernBerkefeld added enhancement New feature or request NEW not yet analyzed new issues get this label labels Mar 25, 2024
@JoernBerkefeld
Copy link
Contributor Author

potential responses:

id found but apparently not downloaded to local disk yet:

{
  "key": "mcdev-issue-1157",
  "name": "mcdev-issue-1157-Mcdev-strips-content",
  "mid": 9999999,
  "error": "file not found on local disk"
}

id found and downloaded previously:

{
  "key": "mcdev-issue-1157",
  "name": "mcdev-issue-1157-Mcdev-strips-content",
  "mid": 9999999,
  "path": "./retrieve/testInstance/testBU/asset/block/mcdev-issue-1157.asset-block-meta.html"
}

id not found:

{
  "error": "id not found"
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request NEW not yet analyzed new issues get this label
Projects
None yet
Development

When branches are created from issues, their pull requests are automatically linked.

1 participant