Placeholder selection

55 views
Skip to first unread message

Serban Tanasa

unread,
Mar 6, 2015, 8:44:43 AM3/6/15
to reporter...@googlegroups.com
Hi everyone,

I am an enthusiastic adopter of the ReporterRs package! Thank you for creating it. In the context of writing to PPTX files, I was curious whether you have (or plan to have) a way of addressing specific placeholders in a given slide. Say I have a slide structured like the one below, and I want to specifically insert into "Body 03". Is there any way of addressing the placeholders by name, and specifying that the output is to be sent to them? It would be extremely useful!

Thanks,
Serban Tanasa

David Gohel

unread,
Mar 6, 2015, 1:52:18 PM3/6/15
to reporter...@googlegroups.com
Hi Serban

Thanks for your enthusiasm! 

The placeholders names are fake id, they do not exists in the pptx template nor in the final presentation. There is no plan for that but there is a long term plan to refactor the whole pptx (to make it easier to maintain), no promise but your suggestion could be integrated. 

For now, there may be a workaround, you can specify where to place your shape everywhere you want within the current slide with arguments offx, offy, width and height with add*** functions(addFlexTable, addPlot, ...). For example :

    doc = addFlexTable( doc, MyFTable, offx = 7, offy = 2, width = 3, height = 3)

Does that help? 

Thanks,
David

Serban Tanasa

unread,
Mar 11, 2015, 9:41:54 AM3/11/15
to reporter...@googlegroups.com
Hi David,

I'll use the workaround for now. Thank you for the super-fast reply!

Atik Pats

unread,
Jul 20, 2017, 8:09:47 AM7/20/17
to ReporteRs
Hi David/Serban,

I wanted to check if this functionality has been added now. I am facing a lot of issues in correctly reading all placeholders from my custom template. I do not see any placeholder ids. Any help is appreciated! Thank you.

Atik

Marleen de Vente

unread,
Sep 13, 2017, 4:34:29 AM9/13/17
to ReporteRs
Hi all,

I've been playing around with the ReporteRs and officer packages. 
Great work, David!


Regarding the placeholders: I would also like to add/replace content by specifically naming that placeholder.  In PowerPoint, on the "Selection pane" it lists all the placeholder names (and you can even rename them to more descriptive names than the default "Title 4" etc!). 
My question: is there a way you could get those "real placeholder names" in the ReporteRs package?

In the officer package it seems quite simple to include, because the placeholder's "real" name is stored in the same xml node as the "id", like this:
<p:cNvPr id="7" name="Content Placeholder 6"/>
And the read_xfrm function takes that id already, so only need to add the name field also:
id     <- xml_attr(xml_child(nodeset, "/p:cNvPr"), "id")
phname <- xml_attr(xml_child(nodeset, "/p:cNvPr"), "name")

But, I couldn't figure out where to change/add this in the ReporteRs package... David? ;-)

Please, if you consider to include this (or of you are willing to give me a pointer of where to start to work on this myself), it would really help in order to have more control of which slide content to replace with what! :)

Happy day!
Marleen

David Gohel

unread,
Sep 13, 2017, 5:20:53 AM9/13/17
to ReporteRs
Hi,

Good suggestion, thanks. I will soon add a new column for that in the results of `officer::layout_properties` .


About ReporteRs, there will be no change, sorry. officer is supposed to replace ReporteRs :) 

KR,
David
Reply all
Reply to author
Forward
0 new messages