anubis2814

@anubis2814@friendica.myportal.social

Este perfil es de un servidor federado y podría estar incompleto. Explorar más contenido en la instancia original.

anubis2814, a developers en

Hey guys, is there something special I need to know about using smarty? I'm back to plugging away on the quiz option, trying to make a dynamic radio button that is clickable and returns a value. I have a version using a js file, that works with an HTML document, but I'm having issues integrating it into tpl files with php variables.
html_radios is a smarty option we have that should create dynamic radio buttons. Problem is I can't make it work even though I'm using this smarty.net/docsv2/en/language.… Which is a copy of a md file we have.
I will put something like:

 {html_radios options=$options_title 
        separator='<br />'}

Into the content/question.tpl file
If I run it as normal, it just spits out code as a result in the poll.
If I run something like this in /model/item.php
$smarty->assign('option_title', $option.name)); It always gives me just a white screen.
I want to make sure there isn't some easy fix that I need to do to smarty to make it work right, it might well be I'm just doing it all wrong with my non-professional newb status. If there isn't I'll just keep pluging and chugging til i figure it out. Just wnt to make sure I'm not wasting my time where there is any easy fix

anubis2814,

@heluecht I don't remember when I stopped last night but the only things I'm getting in my error log are undefined variables.

anubis2814,

It appears that there is some method of defining smarty arrays
The exception it threw now is for $smarty array being undefined. Do i need to "use" a file to make it work?

anubis2814,

Ok so I used the following $smarty = new Smarty();
Now it throws a white screen but nothing shows up in the error log.

anubis2814, a developers en

Can someone tell me what the advantage of using the ! over @ in groups is? I appear to have a very confused understanding after 6 years on this platform. Thanks.

anubis2814,

@hypolite Ah ok. Now can people from activitypub post to forum followers or since they cant "join" only follow does it not show up?

anubis2814, a developers en

I'm poking around at the polling issue that the rest of the fediverse enjoys and I've run into a problem that probably the other person who set the groundwork for the question option ran into and abandoned.
Who designed out field_radio.tpl file? Was that made in house or was that outsourced from somewhere else. If so do they have other radio tpl files for lists.

Just a note that I am a massive beginner. so this is more a challenge than anything else and if it works or not I'll have learned something either way.

</p><ul>
{{foreach $options as $option}}
	<li>
	{{include file="field_radio.tlp field="$option.vote"}} 
	</li>
{{/foreach}}
</ul>
{{$summary}}
</p>
	<div class="settings-submit-wrapper">
			<input type="submit" name="notification-submit" class="settings-submit" value="{{$submit}}"/>
		</div>

This will not work as the field_radio.tpl isn't designed for lists. I can make it look like it should but them the buttons don't switch, because its a list. Every help forum online suggests downloading and outside client for it. If we have a reliable template maker client then what is it? Otherwise I will poke around and figure this out over time as a newb. Might need some js from the looks of it but there might be a much easier solution.

anubis2814,

@heluecht Yeah Why I'm just poking around trying to learn, i doubt I will get very far with it. Trying to find out of we can get a tpl for it or if it has to be made or used from someone else.

anubis2814,

@noidea Yeah it appears to be a bit more complex than that. We only use static radio buttons that are hard coded. Its when it becomes dynamic lists that things break down. It appears to propagate each answer and a button with each foreach and then the buttons are just kind of dumb after that point as they don't repopulate each time to update the change. There may be a way but I'm not skilled enough to know how to do that.

anubis2814,

Every dropdown we use appears to have an associated js file and none of them are dynamic so I'm assuming this will require some form of js file to make it work too.

anubis2814, a developers en

I completely changed files and renamed them in modules and templates. no matter what the page kept coming up the same. It should have accessed the new php file according to routes.config.php. There is no way friendica should be accessing this file.
However apparently smarty3 keeps redirecting things to the old page style. Any idea what to do here?

anubis2814,

NM, I just have to delete the compiled smarty file and it was just fine
Thanks

  • Todo
  • Suscrito
  • Moderado
  • Favoritos
  • random
  • noticiascr
  • CostaRica
  • Todos las revistas