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

Insert Bullets in Template Processor #826

Open
Salman456 opened this issue Jun 27, 2016 · 3 comments
Open

Insert Bullets in Template Processor #826

Salman456 opened this issue Jun 27, 2016 · 3 comments

Comments

@Salman456
Copy link

Salman456 commented Jun 27, 2016

Hi there,

I am trying to replace a text with a bullet numbered text but have not found a way yet. I tried placing a bullet using the PHPWord's variable and line break of but it did not insert a bullet point on a new line and only replaces the text.

I will be thankful if someone can help me out.


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@satriyoz
Copy link

UP!

Is there anyone who can help with this?
i already tried to add xml syntax like
<w:p w14:paraId='7EF14A4F' w14:textId='14974A0E' w:rsidR='00486CE8' w:rsidRPr='00BA6A66' w:rsidRDefault='00DB60D7' w:rsidP='00C059E1'> <w:pPr> <w:pStyle w:val='BodyTextIndent2'/> <w:numPr> <w:ilvl w:val='0'/> <w:numId w:val='38'/> </w:numPr> <w:ind w:left='810' w:right='108' w:hanging='270'/> <w:rPr> <w:rFonts w:ascii='Arial' w:hAnsi='Arial' w:cs='Arial'/> <w:sz w:val='17'/> <w:szCs w:val='17'/> <w:lang w:val='sv-SE'/> </w:rPr> </w:pPr> <w:r> <w:rPr> <w:rFonts w:ascii='Arial' w:hAnsi='Arial' w:cs='Arial'/> <w:sz w:val='17'/> <w:szCs w:val='17'/> <w:lang w:val='sv-SE'/> </w:rPr> <w:t>text here</w:t> </w:r> </w:p>

it does create a new bullet point like it should, but the text is not appear on the side of the bullet point.

@FournyP
Copy link

FournyP commented Sep 27, 2022

Hi

I found the same issue here

Anybody else have solve this problem ?

Have a good day

@FournyP
Copy link

FournyP commented Sep 28, 2022

Hi,

I have found a solution for people who have the same issue

In my template, I have write this :

image

And in my code, I duplicate this section according to the number of bullet point I want and replace variables after the bullet point thanks to index (see https://phpword.readthedocs.io/en/latest/templates-processing.html#cloneblock)

$templateProcessor->cloneBlock('specificKnowledgeSection', \count($contract->getSpecificKnowledge()), true, true);

for ($index = 1; $index <= \count($contract->getSpecificKnowledge()); $index++) {
    $specificKnowledge = $contract->getSpecificKnowledge()[$index - 1];
    $templateProcessor->setValue('specificKnowledge#' . $index, $specificKnowledge);
}

Have a good day !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants