Version Notes
Second Vrsion
Download this release
Release Info
Developer | Tarun Vishnoi |
Extension | tv_faq_new |
Version | 0.1.1 |
Comparing to | |
See all releases |
Code changes from version 0.1.0 to 0.1.1
- app/design/frontend/base/default/layout/faq.xml +20 -0
- app/design/frontend/base/default/template/faq/detail.phtml +34 -0
- app/design/frontend/base/default/template/faq/list.phtml +83 -0
- package.xml +6 -6
- skin/frontend/base/default/css/tv/style.css +21 -0
- skin/frontend/base/default/css/tv/toggle-minus.png +0 -0
- skin/frontend/base/default/css/tv/toggle-plus.png +0 -0
app/design/frontend/base/default/layout/faq.xml
ADDED
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?xml version="1.0"?>
|
2 |
+
<layout version="0.1.1">
|
3 |
+
<faq_index_index>
|
4 |
+
<reference name="head">
|
5 |
+
<action method="addCss"><stylesheet>css/tv/style.css</stylesheet></action>
|
6 |
+
</reference>
|
7 |
+
<reference name="content">
|
8 |
+
<reference name="root">
|
9 |
+
<action method="setTemplate"><template>page/1column.phtml</template></action>
|
10 |
+
</reference>
|
11 |
+
<block type="tv_faq/frontend_list" name="faq_list" template="faq/list.phtml"/>
|
12 |
+
</reference>
|
13 |
+
</faq_index_index>
|
14 |
+
|
15 |
+
<faq_index_show>
|
16 |
+
<reference name="content">
|
17 |
+
<block type="tv_faq/frontend_detail" name="faq_detail" template="faq/detail.phtml"/>
|
18 |
+
</reference>
|
19 |
+
</faq_index_show>
|
20 |
+
</layout>
|
app/design/frontend/base/default/template/faq/detail.phtml
ADDED
@@ -0,0 +1,34 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php $_faq = $this->getFaq() ?>
|
2 |
+
|
3 |
+
<?php if ($_faq): ?>
|
4 |
+
<div class="page-title">
|
5 |
+
<h1><?php echo $this->htmlEscape($_faq->getQuestion()) ?></h1>
|
6 |
+
</div>
|
7 |
+
|
8 |
+
<div class="faq-detail">
|
9 |
+
<p class="faq-date">
|
10 |
+
<?php echo Mage :: getModel('core/date')->date('d.m.Y', $_faq->getPublicationTime()); ?>
|
11 |
+
</p>
|
12 |
+
|
13 |
+
<?php $_content = $_faq->getAnswerHtml() ? $_faq->getAnswer() : $this->htmlEscape($_faq->getAnswer()) ?>
|
14 |
+
<?php if (!empty($_content)): ?>
|
15 |
+
<div class="faq-content">
|
16 |
+
<?php if ($_faq->getAnswerHtml()): ?>
|
17 |
+
<?php echo $_content ?>
|
18 |
+
<?php else: ?>
|
19 |
+
<?php foreach (explode("\n", $_content) as $paragraph): ?>
|
20 |
+
<p><?php echo $paragraph ?></p>
|
21 |
+
<?php endforeach; ?>
|
22 |
+
<?php endif; ?>
|
23 |
+
</div>
|
24 |
+
<?php endif; ?>
|
25 |
+
|
26 |
+
<p><a href="<?php echo Mage :: app()->getStore()->getUrl('faq') ?>" title="<?php echo $this->__('Back to the FAQ overview') ?>"><?php echo $this->__('Back to the FAQ overview') ?></a></p>
|
27 |
+
</div>
|
28 |
+
<?php else: ?>
|
29 |
+
<div class="page-title">
|
30 |
+
<h1><?php echo $this->__('Error') ?></h1>
|
31 |
+
</div>
|
32 |
+
|
33 |
+
<p><?php echo $this->__('The requested FAQ item could not be found!') ?></p>
|
34 |
+
<?php endif; ?>
|
app/design/frontend/base/default/template/faq/list.phtml
ADDED
@@ -0,0 +1,83 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<?php
|
2 |
+
/**
|
3 |
+
* Magento
|
4 |
+
*
|
5 |
+
* NOTICE OF LICENSE
|
6 |
+
*
|
7 |
+
* This source file is subject to the Academic Free License (AFL 3.0)
|
8 |
+
* that is bundled with this package in the file LICENSE_AFL.txt.
|
9 |
+
* It is also available through the world-wide-web at this URL:
|
10 |
+
* http://opensource.org/licenses/afl-3.0.php
|
11 |
+
* If you did not receive a copy of the license and are unable to
|
12 |
+
* obtain it through the world-wide-web, please send an email
|
13 |
+
* to license@magentocommerce.com so we can send you a copy immediately.
|
14 |
+
*
|
15 |
+
* DISCLAIMER
|
16 |
+
*
|
17 |
+
* Do not edit or add to this file if you wish to upgrade Magento to newer
|
18 |
+
* versions in the future. If you wish to customize Magento for your
|
19 |
+
* needs please refer to http://www.magentocommerce.com for more information.
|
20 |
+
*
|
21 |
+
* FAQ accordion for Magento
|
22 |
+
*
|
23 |
+
* Website: www.abc.com
|
24 |
+
* Email: honeyvishnoi@gmail.com
|
25 |
+
*
|
26 |
+
/* @var $this TV_Faq_Block_Frontend_List */
|
27 |
+
?>
|
28 |
+
<div class="page-title">
|
29 |
+
<h1><?php echo $this->__('FAQ List'); ?></h1>
|
30 |
+
</div>
|
31 |
+
|
32 |
+
<?php if ($this->hasFaq()): ?>
|
33 |
+
<?php if ($this->getCategoryCollection()) : ?>
|
34 |
+
<!--<dl class="faq-list">
|
35 |
+
<?php foreach ($this->getCategoryCollection() as $category) : ?>
|
36 |
+
<dt><?php echo $this->htmlEscape($category->getName()); ?></dt><dd><ul class="faq-list">
|
37 |
+
<?php foreach ($this->getItemCollectionByCategory($category) as $item) : ?>
|
38 |
+
<li>
|
39 |
+
<a href="#faq-item-<?php echo $item->getId() ?>">
|
40 |
+
<?php echo $this->htmlEscape($item->getQuestion()); ?>
|
41 |
+
</a>
|
42 |
+
</li>
|
43 |
+
<?php endforeach; ?>
|
44 |
+
</ul></dd>
|
45 |
+
<?php endforeach; ?>
|
46 |
+
</dl>-->
|
47 |
+
<?php else : ?>
|
48 |
+
<ul class="faq-list">
|
49 |
+
<?php foreach ($this->getFaqCollection() as $faqItem): ?>
|
50 |
+
<li>
|
51 |
+
<a href="#faq-item-<?php echo $faqItem->getId() ?>">
|
52 |
+
<?php echo $this->htmlEscape($faqItem->getQuestion()) ?>
|
53 |
+
</a>
|
54 |
+
</li>
|
55 |
+
<?php endforeach; ?>
|
56 |
+
</ul>
|
57 |
+
<?php endif; ?>
|
58 |
+
|
59 |
+
<dl class="faq-items">
|
60 |
+
<?php foreach ($this->getFaqCollection() as $faqItem): ?>
|
61 |
+
<dt id="faq-que-<?php echo $faqItem->getId() ?>" onclick="slide('faq-que-<?php echo $faqItem->getId() ?>','faq-ans-<?php echo $faqItem->getId() ?>')">
|
62 |
+
<?php echo $this->htmlEscape($faqItem->getQuestion()) ?>
|
63 |
+
</dt>
|
64 |
+
<dd id="faq-ans-<?php echo $faqItem->getId() ?>" style="display:none;">
|
65 |
+
<?php $_process = Mage::helper('cms')->getBlockTemplateProcessor();?>
|
66 |
+
<?php echo $_process->filter($faqItem->getAnswer()); ?>
|
67 |
+
</dd>
|
68 |
+
<?php endforeach; ?>
|
69 |
+
</dl>
|
70 |
+
<?php else: ?>
|
71 |
+
<p class="faq-items"><?php echo $this->__('There are no FAQ items at the moment.') ?></p>
|
72 |
+
<?php endif; ?>
|
73 |
+
<script type="text/javascript">
|
74 |
+
function slide(element1, element2){
|
75 |
+
new Effect.toggle(element2,'Slide', {duration:1});
|
76 |
+
if( $(element1).hasClassName("active") ){
|
77 |
+
$(element1).removeClassName("active");
|
78 |
+
}
|
79 |
+
else{
|
80 |
+
$(element1).addClassName("active");
|
81 |
+
}
|
82 |
+
}
|
83 |
+
</script>
|
package.xml
CHANGED
@@ -1,18 +1,18 @@
|
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>tv_faq_new</name>
|
4 |
-
<version>0.1.
|
5 |
<stability>stable</stability>
|
6 |
-
<license>OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension allows admin to enter questions and answers and list them on front end.</summary>
|
10 |
<description>This extension allows admin to enter questions and answers and list them on front end.</description>
|
11 |
-
<notes>
|
12 |
<authors><author><name>tarun vishnoi</name><user>tarun_ons</user><email>honeyvishnoi@gmail.com</email></author></authors>
|
13 |
-
<date>2016-
|
14 |
-
<time>
|
15 |
-
<contents><target name="
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
1 |
<?xml version="1.0"?>
|
2 |
<package>
|
3 |
<name>tv_faq_new</name>
|
4 |
+
<version>0.1.1</version>
|
5 |
<stability>stable</stability>
|
6 |
+
<license uri="https://opensource.org/licenses/osl-3.0.php">OSL</license>
|
7 |
<channel>community</channel>
|
8 |
<extends/>
|
9 |
<summary>This extension allows admin to enter questions and answers and list them on front end.</summary>
|
10 |
<description>This extension allows admin to enter questions and answers and list them on front end.</description>
|
11 |
+
<notes>Second Vrsion</notes>
|
12 |
<authors><author><name>tarun vishnoi</name><user>tarun_ons</user><email>honeyvishnoi@gmail.com</email></author></authors>
|
13 |
+
<date>2016-09-29</date>
|
14 |
+
<time>18:28:00</time>
|
15 |
+
<contents><target name="magelocal"><dir name="TV"><dir name="Faq"><dir name="Block"><dir name="Adminhtml"><dir name="Category"><dir name="Edit"><file name="Form.php" hash="92dff8a012206aae13e4c2ae3759c5f9"/><dir name="Tab"><file name="Form.php" hash="46d4ab06cbd0099a31e4ac99b6de39fc"/></dir><file name="Tabs.php" hash="69bd08df860a478ccf90fc9fa2c56ae7"/></dir><file name="Edit.php" hash="3b58bcd78038a5e943b90da796598d4c"/><file name="Grid.php" hash="319356af6e0e6329a42b779834456bc0"/></dir><file name="Category.php" hash="59a310d0fa62886828e9a53afcf35954"/><dir name="Item"><dir name="Edit"><file name="Form.php" hash="6ec7bc1dea4b127e65298a15ffbe3ee4"/><dir name="Tab"><file name="Form.php" hash="1d9bf36cf280acdee246b61e62ef5320"/></dir><file name="Tabs.php" hash="1fc1ab43dcf72b6e63bc785f4e83effb"/></dir><file name="Edit.php" hash="ee55af3d2c18c06d99c91f50bc38bce6"/><file name="Grid.php" hash="b172258c705c6ac5a10cd28fd513ac2a"/></dir><file name="Item.php" hash="de90e2d7348bf60db6cb0a852f4b558b"/></dir><dir name="Frontend"><file name="Detail.php" hash="2425432562d71949bb7bbc1166915b49"/><file name="List.php" hash="ca84aa33f29c6c817623cd42043cab5a"/></dir></dir><dir name="Helper"><file name="Data.php" hash="b6c919e0c4d5e54e28779c389872f7c2"/><file name="Jumplist.php" hash="c6b5469ffddef4afbb9825787af363ae"/><file name="JumplistItem.php" hash="3323517e20c5db4c5b41caa17a56dd2e"/></dir><dir name="Model"><file name="Category.php" hash="9e928e4f26ac0ad1965b912bd43ff0d4"/><file name="Faq.php" hash="c93d162961776b7c1d4a887b12e15d98"/><dir name="Mysql4"><dir name="Category"><file name="Collection.php" hash="c6f262642e9a3558ef599582e402cf39"/></dir><file name="Category.php" hash="c084383e9031018b4bb93fed37bad39e"/><dir name="Faq"><file name="Collection.php" hash="909b63da3d8c1fb177a49855286ce951"/></dir><file name="Faq.php" hash="691c7c4015628e45671daa9f6a847daf"/></dir></dir><dir name="Wysiwyg"><dir name="Images"><dir name="Content"><file name="Files.php" hash="96ba466e162a5b304e05581a1b9981c2"/><file name="Newfolder.php" hash="e53addca9a2a2a705e97bd493c57833c"/><file name="Uploader.php" hash="d46965540d2986ff74f9c2c030f2dbb4"/></dir><file name="Content.php" hash="fa97cc6ae723a62eeb137dcb23851225"/><file name="Tree.php" hash="6de3fa85978962413118cfc15b5f8f82"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Faq"><file name="CategoryController.php" hash="f66c2305c654f36cb5dc8e2682e135f2"/></dir><file name="FaqController.php" hash="876b26440bb40188b38cfc7b98a38b21"/></dir><file name="IndexController.php" hash="3e8c7abb09eb92da75cf562eb8d3a890"/></dir><dir name="etc"><file name="adminhtml.xml" hash="8a4d6da6397de73caad6d78cd433ed88"/><file name="config.xml" hash="42ecc7df781233659a4d274fa7b11e4b"/></dir><dir name="sql"><dir name="faq_setup"><file name="mysql4-install-0.1.0.php" hash="1a5a6fc58d62fb45706bd94a4c9073cf"/><file name="mysql4-install-1.0.7.php" hash="5914476063c2aef33bb3adb0bdc3effe"/><file name="mysql4-upgrade-1.0.6-1.0.7.php" hash="b63f7b5b2ff00f632b0be0582ef7a530"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="TV_Faq.xml" hash="690d6d2c3226982e59507bfc619ceed2"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="faq.xml" hash="d6d4c73235f8fec0b08f545f178db4eb"/></dir></dir></dir></dir><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="faq.xml" hash="9306a6a1548a87e27a41ce1802d78251"/></dir><dir name="template"><dir name="faq"><file name="detail.phtml" hash="945c73c968c7c980c1acc4bed4a4cc4a"/><file name="list.phtml" hash="104cc35852b68e88a201fa270623d3d1"/></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="frontend"><dir name="base"><dir name="default"><dir name="css"><dir name="tv"><file name="style.css" hash="c9ac6f68292f8c3d725a42c6713dfb18"/><file name="toggle-minus.png" hash="31d75504726b3f09a9e7af2115fb58c9"/><file name="toggle-plus.png" hash="c8b91476d2cf1c55b6e2010c02a96074"/></dir></dir></dir></dir></dir></target></contents>
|
16 |
<compatible/>
|
17 |
<dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php></required></dependencies>
|
18 |
</package>
|
skin/frontend/base/default/css/tv/style.css
ADDED
@@ -0,0 +1,21 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
dl.faq-items dt {
|
2 |
+
text-transform: none;
|
3 |
+
margin-bottom: 10px;
|
4 |
+
font-size: 16px;
|
5 |
+
padding: 8px 8px 8px 30px;
|
6 |
+
background-image: url('toggle-plus.png');
|
7 |
+
background-position: 10px center;
|
8 |
+
background-repeat: no-repeat;
|
9 |
+
color: #333;
|
10 |
+
cursor:pointer;
|
11 |
+
background-color: #cfcfcf;
|
12 |
+
border-radius:4px;
|
13 |
+
}
|
14 |
+
dl.faq-items dt:hover {
|
15 |
+
color: #0489B7;
|
16 |
+
}
|
17 |
+
dl.faq-items dt.active{
|
18 |
+
background-image: url('toggle-minus.png') !important;
|
19 |
+
background-position: 10px center;
|
20 |
+
background-repeat: no-repeat;
|
21 |
+
}
|
skin/frontend/base/default/css/tv/toggle-minus.png
ADDED
Binary file
|
skin/frontend/base/default/css/tv/toggle-plus.png
ADDED
Binary file
|