TinyButStrong - the PHP Template Engine
Categories > OpenTBS with PPTX >

Not working properly with PowerPoint 2010.

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs

By: Alejandro
Date: 2012-10-16
Time: 12:27

Not working properly with PowerPoint 2010.

Hi everybody. I'm new to TBS but seems to be a very important discover for me!

I've tried to simplify the sample to better understand how it works, but I'm stuck, I've created this very simple code:
<?php
include_once('tbs/tbs_class.php');
include_once('tbs_plugin/tbs_plugin_opentbs.php');
$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->LoadTemplate("prueba.pptx");
$yourname="test";
$TBS->Show(OPENTBS_DOWNLOAD, "test.pptx");
?>

For the "prueba.pptx" I've just opened Powerpoint and, in the default slide it provides, I've write [onshow.yourname] in the title and [onshow..now;frm=‘yyyy-mm-dd hh:nn:ss’] in subtitle

But it doesn't work (it shows the powerpoint but with no substitutions).

If I use your provided demo_ms_powerpoint.pptx it works like a charm!!!

what am I doing wrong in my template??

Thx on advance for your help.

regards
Alejandro
UPDATE!!

To see how it works I've made this change to my code:

<?php
include_once('tbs/tbs_class.php');
include_once('tbs_plugin/tbs_plugin_opentbs.php');
$TBS = new clsTinyButStrong;
$TBS->Plugin(TBS_INSTALL, OPENTBS_PLUGIN);
$TBS->LoadTemplate("prueba.pptx");
$yourname="test";
echo $TBS->Source;
?>


If I use demo_ms_powerpoint.pptx I can see this in the middle of the html/xml file:

<a:r>
  <a:rPr lang="fr-FR" sz="2000" b="1" noProof="1" smtClean="0" />
  <a:t>[onshow.yourname]</a:t>
  </a:r>
- <a:r>
But, if I use my prueba.pptx I get this:
<a:p>
- <a:r>
  <a:rPr lang="es-ES" dirty="0" />
  <a:t>[</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" dirty="0" err="1" smtClean="0" />
  <a:t>onshow.yourname</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" smtClean="0" />
  <a:t>]</a:t>
  </a:r>
  <a:endParaRPr lang="es-ES" dirty="0" />
  </a:p>

Even though the echo prints correctly [onshow.yourname] on screen.

Obiously, when you parse the source, you will never find the token.

I'm gonna try to change tokens to see what happens... I'll followup
By: Alejandro
Date: 2012-10-16
Time: 14:32

Re: Not working properly with PowerPoint 2010.

Hi, it's me again I cannot edit the previos post any more...

Ok, I've change the delimiters to iI and fF by instantiating tbs with:

$TBS = new clsTinyButStrong("iI,fF");

Now, iIonshow.yournamefF works, but iIonshow..now;frm=‘yyyy-mm-dd hh:nn:ss’fF doesn't

If I get the source this is what I get:


- <a:p>
  <a:pPr lvl="1" algn="l" />
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" err="1" smtClean="0" />
  <a:t>iIonshow</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" />
  <a:t>..</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" err="1" />
  <a:t>now;frm</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" />
  <a:t>='</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" err="1" />
  <a:t>yyyy</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" />
  <a:t>-mm-</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" err="1" />
  <a:t>dd</a:t>
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" dirty="0" />
  <a:t />
  </a:r>
- <a:r>
  <a:rPr lang="es-ES" b="1" smtClean="0" />
  <a:t>hh:nn:ss'fF</a:t>
  </a:r>

Obiously, something is wrong in how I'm saving the powerpoint, but how can I fix it?

Thks.
By: Skrol29
Date: 2012-10-16
Time: 18:22

Re: Not working properly with PowerPoint 2010.

Hi Alejandro,

It seems that PowerPoint inserts spelling information in the contents. This information is breaking TBS tags.
There is a similar behavior in Ms Word. OpenTBS do cleanup spelling information in DOCX but not (yet) in PPTX.
My suggestion is that you select the text in PowerPoint and switch options to not checking spelling and grammar. This should delete spelling information in the selected text.
By: Alejandro
Date: 2012-10-20
Time: 18:17

Re: Not working properly with PowerPoint 2010.

GOT IT!!!

After removing spell check, you have to DELETE all the text that is not working, save the powerpoint, close powerpoint, open it again, reload, and paste the data and save again.

Now it works!

Thx for your help
By: Skrol29
Date: 2012-10-20
Time: 22:33

Re: Not working properly with PowerPoint 2010.

You can also try with OpenTBS version 1.8.0 beta which is available fr download here:
http://www.tinybutstrong.com/news.php

There is a new feature which is supposed to fix the behavior you've got.