Add slide link to a placeholder in the current slide.
Arguments
- x
an rpptx object
- type
placeholder type
- id
placeholder index (integer) for a duplicated type. This is to be used when a placeholder type is not unique in the layout of the current slide, e.g. two placeholders with type 'body'. To add onto the first, use
id = 1
andid = 2
for the second one. Values can be read fromslide_summary
.- id_chr
deprecated.
- ph_label
label associated to the placeholder. Use column
ph_label
of result returned byslide_summary
. If used,type
andid
are ignored.- slide_index
slide index to reach
See also
Other functions for placeholders manipulation:
ph_hyperlink()
,
ph_remove()
Examples
fileout <- tempfile(fileext = ".pptx")
loc_title <- ph_location_type(type = "title")
doc <- read_pptx()
doc <- add_slide(doc)
doc <- ph_with(x = doc, "Un titre 1", location = loc_title)
doc <- add_slide(doc)
doc <- ph_with(x = doc, "Un titre 2", location = loc_title)
doc <- on_slide(doc, 1)
slide_summary(doc) # read column ph_label here
#> type id ph_label offx offy cx cy
#> 1 title 2cac8f72-e737-4f74-a901-4f5c4ad4c604 Title 1 0.5 0.3003478 9 1.25
#> rotation fld_id fld_type text
#> 1 NA <NA> <NA> Un titre 1
doc <- ph_slidelink(x = doc, ph_label = "Title 1", slide_index = 2)
print(doc, target = fileout)