Aller au contenu principal

Find pages in green tree which have no connection to blue tree

Commentaires

3 commentaires

  • Zendesk API User
    Author: bIT_sosswald - 4/11/2019 7:25

    Hi Marco,

    take a look into the API documentation for Page (FirstSpirit Access-API) there you will see that a Page is implementing StoreElement (FirstSpirit Access-API) and StoreElement provides some methods like "getOutgoingReferences()", "getIncomingReferences()" and also "hasIncomingReferences()".

    With that methods you can see where a StoreElement is used (incoming references) and what other elements it uses (outgoing references).

    The same should work for media files.

    So you should be able to write a script / module which checks which elements are used and which are not.

    But you must take into consideration, that (as far as i know) this methods will not return a value, when e.g. a media is referenced hard coded directly in the template code such as $CMS_REF(media:"media_uid")$.

    Greetings

    Sandro

    0
  • Zendesk API User
    Author: Julia1 - 4/11/2019 8:59

    Hi Marco,

    another idea for editors to find pages that are not being used or generated could be the following:

    1. Go to the green tree pages

    2. Right click on a page opens the menue

    3. Choose "Extras" and then "Show usages" (or use Ctrl+U)

    Then either a new window appears which shows you the connection to a blue tree page – now you know if the page is generated and in use – or you get the message "No use found". Then you know that this page is not generated and the page can for example be removed.

    The contra of this method is that it is slower compared with using a script (as sandro suggested). The pro is that every editor can do this on his / her own.

    May depend on how many pages you have in your project.

    Good luck!

    0
  • Zendesk API User
    Author: mbergmann - 4/11/2019 22:37

    Hi Sandro,

    hardcoded references are indeed evaluated if they are "simple" which means they do not use expressions or variables.

    Example:

    $CMS_REF(media:"my_picture")$

    ... will create an entry in the reference graph (CTRL+R), while

    $CMS_REF(media:"my_"+"picture")$

    will not.

    That‘s the reason why I always strongly advise against using things like

    $CMS_REF(media:"flag_"+#global.language.abbreviation.toLowerCase)$

    Michael

    0

Vous devez vous connecter pour laisser un commentaire.