FAQ

Create help / instructions

Create efficient instructions embeded into your software so that you can explain to your customers how to use build in. 
-> Add instructions for each section of the software, to keep the help conscise. 
-> View All function allows to view all / print to read through all the help if needed. 







# 1 > Popup

This will explain how to create a popup for many parts of the software. This creates a button to click and it displays info about that specific part of the software. 





# 2 > Create element

Create a new element (Views/Elements/a/help-pb.ctp)

<?php $data = json_decode(file_get_contents('https://portal.projectbrowser.com/letters/view/'.$link), true);

if (!isset($unique)) {
$unique = 1;
}
?>
<i style="float: right; margin-top: 3px;" class="btn btn-primary btn-border pull-right add-button" data-toggle="modal" data-target="#myModal<?= $unique; ?>">?</i>

<!-- Modal -->
<div class="modal fade" id="myModal<?= $unique; ?>" role="dialog">
<div class="modal-dialog">

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4>
<?= $this->Html->link($data['Letter']['subject_en'], array(
'user' => false,
'controller' => 'Pages',
'action' => 'help',
$link
), array('target' => '_blank')); ?>
</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>

</div>
<div class="modal-body">


<p>
<?= $data['Letter']['content_en']; ?>
</p>


<?php foreach ($data['LettersStep'] as $step): ?>
<p>
<h3>
<?= $step['title_en']; ?>
</h3>
<span>
<?= $step['description_en']; ?>

</span>

<img src="<?= $step['link']; ?>" style="max-width: 100%;"/>

<br/>


</p>

<?php endforeach; ?>



</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>

</div>
</div>




# 3 > Create script

Add this to the view, which will make the help button appear 

<?= $this->Element('a/help-pb', array(
'link' => 'CHANGE_ME_TO_PB_CODE'
)); ?>




# 4 > Controller

In the PAGES controller add the following functions

function help($link) {

$this->set('link', $link);
}

function helpAll() {

}




# 5 > Help view

Create a NEW view in Pages/help.ctp

 

<?php
if (!isset($link)) die('missing LINK');
?>

<style type="text/css">
@media print
{
.each{
page-break-inside: avoid;
}
}
</style>

<?php $data = json_decode(file_get_contents('https://portal.projectbrowser.com/letters/view/'.$link), true); ?>

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4>
<?= $this->Html->link($data['Letter']['subject_en'], array(
'user' => false,
'action' => 'help',
$link
), array('target' => '_blank')); ?>

- <?= $this->Html->link('View All', array(
'action' => 'helpAll'
)); ?>
</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">

<p>
<?= $data['Letter']['content_en']; ?>
</p>


<?php foreach ($data['LettersStep'] as $step): ?>

<div class="each">
<h3 style="border-bottom: 1px solid grey;">
<?= $step['title_en']; ?>
</h3>

<span>
<?= $step['description_en']; ?>

</span>

<img src="<?= $step['link']; ?>" style="max-width: 100%;"/>



</div>




<?php endforeach; ?>



</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>






# 6 > Help-all view

Create another view HELP-ALL
-> Add all the unique links to the top of the file, this will load each link from project browser 

 

<?php
$all = array(
'', //add first link here from projectbrowser
'', //add second link here from pb
'', //add third link here from pb
)
?>

<style type="text/css">
@media print
{
.each{
page-break-inside: avoid;
}
}
</style>


<?php foreach ($all as $link): ?>


<?php $data = json_decode(file_get_contents('https://portal.projectbrowser.com/letters/view/'.$link), true); ?>

<!-- Modal content-->
<div class="modal-content">
<div class="modal-header">
<h4>
<?= $this->Html->link($data['Letter']['subject_en'], array(
'user' => false,
'action' => 'help',
$link
), array('target' => '_blank')); ?>
</h4>
<button type="button" class="close" data-dismiss="modal">&times;</button>
</div>
<div class="modal-body">

<p>
<?= $data['Letter']['content_en']; ?>
</p>


<?php foreach ($data['LettersStep'] as $step): ?>

<div class="each">
<h3 style="border-bottom: 1px solid grey;">
<?= $step['title_en']; ?>
</h3>

<span>
<?= $step['description_en']; ?>

</span>

<img src="<?= $step['link']; ?>" style="max-width: 100%;"/>



</div>



<br/>
<br/>


<?php endforeach; ?>



</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div>




<?php endforeach; ?>




# 7 > Create in Project Browser

All steps reside on project browser
-> Logon to project browser and create the DOC & Steps