aem - What does CQ5's Placeholder.getDefaultPlaceholder exactly do? -


the api docs not descriptive:

get default placeholder component incl. title text information

here's method signature:

public static string getdefaultplaceholder(servletrequest slingrequest,                                            component component,                                            string defaultplaceholder) 
  1. what's placeholder? is/should returned getdefaultplaceholder?
  2. what's purpose of defaultplaceholder? should pass defaultplaceholder? happen if pass null?

when component not have content defined need put placeholder occupy place (for editor know there's component there). getdefaultcomponent returns html snippet works placeholder. consists of empty div attributes class , data-emptytext title of component value.

<div class="" data-emptytext="component.gettitle()"></div> 

you can pass additional parameter list of strings , added in class attribute of div.

getdefaultplaceholder(servletrequest slingrequest,                       component component,                       string defaultplaceholder,                       string... addclasses) 

Comments

Popular posts from this blog

user interface - How to replace the Python logo in a Tkinter-based Python GUI app? -

objective c - Greedy NSProgressIndicator Allocation -

how to set an OCR language in Google Drive -